Search code examples
google-apps-scriptgmailgoogle-appsgmail-addons

Trigger a Google App script when "Compose" button is clicked in Gmail


I am developing a Gmail add-on and stuck at a point where I have to trigger my one app script function when compose button is clicked, So my use case is that whenever the compose button is clicked my app script function will return the text for the draft to be shown in the compose mail window and user can edit that draft and send it, I found out that there are compose actions available inside Gmail addons (https://developers.google.com/gmail/add-ons/how-tos/compose) but that is possible when on an event triggered within your Gmail addon UI. Apart from this I can only see one "unconditional" trigger which is triggered whenever any gmail message is opened ( https://developers.google.com/gmail/add-ons/how-tos/building#contextual_triggers ). So is there any workaround for my use case? is it possible on the first place?


Solution

  • This is now possible.. User can extend the compose user interface with compose action, Please see the below url for more details.

    https://developers.google.com/gmail/add-ons/how-tos/extending-compose-ui