Get subject, body and attachment info from Compose UI in gmail addon

100 views
Skip to first unread message

nilesh ghadshi

unread,
Jun 4, 2019, 4:48:23 AM6/4/19
to Google Apps Script Community
I have this gmail addon which has a composeTrigger defined in appscript.json like this.
    "composeTrigger": {
      "selectActions": [
        {
          "text": "ComposeTrigger",
          "runFunction": "composeTrigger"
        }
      ],
      "draftAccess": "METADATA"
    },
In code.gs, I have defined composeTrigger as:

function composeTrigger(event) {
    Logger.info(event.draftMetadata)
}

Now, this draftMetadata only contains details of recipients (to, cc, bcc).

I want to access the subject, body, and attachments also, but I have been unable to do so.
How can I get this data?

Romain Vialard

unread,
Jun 4, 2019, 5:17:47 AM6/4/19
to Google Apps Script Community
Reply all
Reply to author
Forward
0 new messages