如何在 Google Apps 脚本中触发后几分钟发送自动回复?
我有一个像这样的 Google Apps 脚本代码,我在提交 Google 表单后发送自动回复电子邮件。这将在表单提交后立即发送一封电子邮件,但有没有办法在 Google 表单中提交表单后 5 分钟发送此自动回复?
function autoReply(e) {
var values = e.values;
...
var email = value3;
var title = "EMAIL TITLE COMES HERE";
var body = `
DEAR CUSTOMER,
EMAIL BODY COMES HERE
`;
GmailApp.sendEmail(email, title, "", {
htmlBody: body
});
I have a Google Apps Script code like this where I am sending an autoreply email upon submission of a Google Form. This will send an email immediately after the form submission but is there a way to send this autoreply 5 minutes after the form is submitted in Google Form?
function autoReply(e) {
var values = e.values;
...
var email = value3;
var title = "EMAIL TITLE COMES HERE";
var body = `
DEAR CUSTOMER,
EMAIL BODY COMES HERE
`;
GmailApp.sendEmail(email, title, "", {
htmlBody: body
});
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用
Utilities.sleep
,其最大允许值为5分钟/300000毫秒在负责操作发送部分的行之前使用此方法。
参考
Utilities.sleep
You can use
Utilities.sleep
, its max allowed value is 5 minutes/300000 millisecondsUse this method before the lines which take care of the sending part of operation.
Reference
Utilities.sleep