I am writing AppScript to develop an Add On to allow user to move the current thread under a label. For the purpose of fetching current thread id.
BuildAddOn(e)
function buildAddOn(e) {
// Activate temporary Gmail add-on scopes.
var accessToken = e.messageMetaData.accessToken;
GmailApp.setCurrentMessageAccessToken(e.messageMetadata.accessToken);
var messageId = e.messageMetadata.messageId;
While I try to run the function, the following error comes:
TypeError: Cannot read property "messageMetaData" from undefined. (line 3, file "Code")