I have create simple gmail addon using google script,in that i have struggle here,
how to use onclick methond in anchor when we click anchor tage we need perform some action,i have checked the document, i couldn't find any methods The below code i have tried,
section.addWidget(CardService.newTextParagraph().setText('<a href="" onclick="notificationCallback">TestLink</a>'))
Thanks in advance
It seems that <a>
cannot be used for gmail add-on. A part of tags for decorating strings can be used. For example, there are <b>
and <u>
. So as a workaround, how about using this?
section.addWidget(CardService.newTextParagraph().setText('<a href="" onclick="notificationCallback">TestLink</a>'))
section.addWidget(CardService.newTextButton().setText('TestLink').setOnClickAction(notificationCallback))
If I misunderstand your question, I'm sorry.
Since found this, added here.
basic HTML formatting: https://developers.google.com/gmail/add-ons/concepts/widgets#text_formatting.