我需要一个按钮来创建草稿并更新当前的卡片,但是我一次只能使用其中 1 个按钮。
// onGmailMessage.gs
CardService.newTextButton()
.setText('Create draft and update card')
.setComposeAction(CardService.newAction().setFunctionName('updateDraft'), CardService.ComposedEmailType.REPLY_AS_DRAFT)
这有效:
// updateDraft()
return CardService.newComposeActionResponseBuilder()
.setGmailDraft(draft)
.build()
这不起作用:
// FIXME: The value returned from Apps Script has a type that cannot be used by the add-ons platform. Also make sure to call build on any builder before returning it.
return [
// Update the draft
CardService.newComposeActionResponseBuilder().setGmailDraft(draft).build(),
// Update the card
CardService.newActionResponseBuilder()
.setNavigation(
CardService.newNavigation().popToRoot().updateCard(onGmailMessage(e))
)
.setStateChanged(true)
.build(),
]