我正在使用以下脚本在提交表单时生成电子邮件回复。我想知道是否有办法进一步完善 htmlBody var 的 HTML 代码。例如,我想定义 "font face = "tahoma" 但是添加引号会导致变量中断。我该怎么做?
function onFormSubmit(e) {
var custName = e.values[2];
var toAddress = e.values[3];
var subject = "Thank you for your Support Request";
var htmlBody = "<h2>Hi " + custName + ",</h2><br/><Thank you for contacting our support team. Your support ticket has been created and one of our support engineers will be in touch shortly to help you resolve your issue and answer any questions you may have. Please do not reply to this message via e-mail. This address is automated, unattended, and cannot help with questions or requests.<br/><hr><i>Company Name: " + e.values[1] + "<br/>Ticket type: " + e.values[4] + "<br/> Priority: " + e.values[5] + "<br/>Ticket Subject: " + e.values[6] + "<br/>Description: " + e.values[7] + "</p1></i>";
var optAdvancedArgs = {name: "Support Team", htmlBody: htmlBody, replyTo: "no-reply@domain.com"};
MailApp.sendEmail(toAddress, subject, htmlBody, optAdvancedArgs);
}