GmailApp.sendEmail() 添加回复到地址

GmailApp.sendEmail() Add reply to address

我的 google 脚本应用程序中有这段代码,每次用户提交表单时,代码都会向收件人发送一封电子邮件。

function LeadNotifier(e) {

 var values = e.values;
  var htmlBody = '<div background:#E5E8E8;><h2 style="color:#154360;">MENSAJE WEB E.LUCIANA<h2><ul>';
  for (var i=0; i < values.length; i++) {

    var data = values[i];
    htmlBody += '<li>' + ": " + data + '</li>';
  };
  htmlBody += '</ul><h3 ><strong style="color:green;" >Web Site:</strong> Edificio Luciana</h3></div>';
  GmailApp.sendEmail('ventas@edificioluciana.com','Cotización de Departamento','',       {htmlBody:htmlBody});
   GmailApp.sendEmail("starjuster@gmail.com","gomez_isaac@outlook.com","TPS report status",{htmlBody:htmlBody});

}

但现在我的客户想要添加用户的电子邮件作为回复,这样他们在回复客户时就不必填写该字段。

有办法实现吗?

根据documentation,您可以在选项中设置replyTo字段。

GmailApp.sendEmail("recipient@example.com", "Subject", "Body", {
  htmlBody: htmlBody,
  replyTo: "replyto@example.com"
});