1

I'm working on Gmail add-on that allows to start new draft/reply using email template. User can navigate to templates list and start new draft by clicking one of them (Decorated text widget). I'm wondering is there a way to set the navigation in add-on after draft was started. I would like to close templates menu and get the user back to previous page.

Tried to combine actions on widget like:

templateCard
                .setComposeAction(
                  myComposeAction,
                  CardService.ComposedEmailType.STANDALONE_DRAFT)
                .setOnClickAction(
                  myNavigationAction
                )

But it doesn't work. Only compose action is running.

1 Answers1

1

This is currently not possible. Based on Google's Documentation:

A UI object can only have one of setOpenLink(openLink), setOnClickAction(action), setOnClickOpenLinkAction(action), setAuthorizationAction(action), or setComposeAction(action, composedEmailType) set.

You would need to add an additional UI element with the .setOnClickAction() method. I found this post where a similar scenario was given. I'd highly recommend you to submit a feature request outlining the limitations and your current use case, maybe this could be updated in the future.

Link to Google Workspace Add-ons Feature Requests

Bryan Monterrosa
  • 1,385
  • 1
  • 3
  • 13