简体   繁体   English

如何编写条件Gmail附加触发器?

[英]How to write a conditional Gmail add-on trigger?

I would like the addon to reload only when a new thread is selected, instead of reloading for every different message. 我希望插件仅在选择新线程时才重新加载,而不是针对每个不同的消息重新加载。

"contextualTriggers": [{
  "unconditional": {
  },
  "onTriggerFunction": "buildAddOn"
}]

You can use CacheService to track the ID of the current Gmail thread inside the buildAddon method. 您可以使用CacheService在buildAddon方法中跟踪当前Gmail线程的ID。 If the thread Id changes, call the main method else skip. 如果线程ID更改,请调用main方法,否则跳过。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM