【发布时间】:2018-02-03 16:03:17
【问题描述】:
我正在使用 Google Apps 脚本 (http://script.google.com) 为 gmail 编写一个自动回复工具。
In the docs,我没有找到任何发送 Gmail 的功能预设回复。 没有这个功能吗?
如果没有,您将如何处理?我想过用 gmail 给自己发一封电子邮件:
To:example@gmail.com
From:example@gmail.com
Subject:This is a canned response ID1847
Hi
This is a test
为其添加标签mycannedresponse,然后在Apps脚本中从代码中加载此邮件:
var threads = GmailApp.search("label:mycannedresponse ID1847");
if (threads.length != 1) {
// error: the canned response ID... is not unique
} else {
threads[0].getBody(...)
threads[0].getPlainBody(...)
}
有没有更详细的方法可以做到这一点?
【问题讨论】:
-
并不奇怪:有许多功能可通过 Apps 脚本没有的方法使用。我要么硬编码预设回复,要么将它们存储在一些电子表格中以便于编辑。
标签: javascript google-apps-script gmail gmail-api