Skip to content

Instantly share code, notes, and snippets.

@iskenxan
Created March 25, 2019 03:25
Show Gist options
  • Save iskenxan/deb90c4ad7f32c75021437573c06e999 to your computer and use it in GitHub Desktop.
Save iskenxan/deb90c4ad7f32c75021437573c06e999 to your computer and use it in GitHub Desktop.
Gmail add-on basic setup
function buildAddOn(e) {
var accessToken = e.messageMetadata.accessToken;
GmailApp.setCurrentMessageAccessToken(accessToken);
var textWidget = CardService.newTextParagraph().setText('Hello World')
section.addWidget(textWidget);
var card = CardService.newCardBuilder()
.setHeader(CardService.newCardHeader()
.setTitle('Addon Demo'))
.addSection(section)
.build();
return [card];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment