
[英]Send Email to Owner on Form Submit and Grab the Email of Submitter at the back end and Clear the Form
[英]Send an email on behalf a form submitter
我有一个链接到电子表格的表单,每次有人提交表单时,我们都会跟踪他们的 email 地址。 当用户提交表单时,我也有一个触发器,它发送一个 email。
问题是所有电子邮件都是使用我的 email 地址发送的。 我想使用表单提交者 email 地址发送该 email。 我怎样才能做到这一点。
我一直在使用GmailApp.sendEmail()
并且作为选项我有:
let lastRow = ss.getActiveSheet().getLastRow();
const emailFrom = Sheets.Spreadsheets.Values.get("FILE_ID", `form responses!B${lastRow}:B${lastRow}`);
const options = {
htmlBody: message,
replyTo: data.email,
cc: emailCc,
'from': emailFrom
};
GmailApp.sendEmail(emailTo, subject, body, options)
我认为代码中有错字。
你应该更换:
const options = {
htmlBody: message,
replyTo: data.email,
cc: emailCc,
'from': emailFrom
};
至:
const options = {
htmlBody: message,
replyTo: data.email,
cc: emailCc,
from: emailFrom
};
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.