之前我使用以下代码在 Gmail 插件中显示装饰文本,但相同的代码现在仅显示没有图标的文本。有没有新的方法或其他方式来实现相同的功能?
var card = CardService.newCardBuilder();
var section = CardService.newCardSection(); // Create a card section
var htmlContent = 'Add Card';
var decoratedText = CardService.newDecoratedText()
.setText(htmlContent)
.setOnClickAction(CardService.newAction().setFunctionName("showFirstCard"))
.setIconUrl("https://i.imgur.com/x5Mh3vL.png");
section.addWidget(decoratedText);
card.addSection(section);
return card.build();
我们也遇到了同样的问题。
.addWidget()
.setIconUrl('url..')
更改为
.addWidget()
.setStartIcon(
CardService.newIconImage().setIconUrl('url..'),
)
来源: https://developers.google.com/apps-script/reference/card-service/card-service
还得更新
"@types/google-apps-script": "^1.0.82",