我是这个人的新手,但有一个我无法找到答案的问题。我正在为我的公司制作一个定制的CRM系统。当客户致电时,应答员工将填写谷歌表格。他们必须从列表中选择一个项目经理。当他们提交表格时,我希望自动发送一封电子邮件给该项目经理,通知他有一个他需要联系的新客户。
感谢您的帮助。请让我知道我需要分享的任何其他信息,以便在填充GForm结果的表格的脚本中创建。
答案 0 :(得分:1)
好吧,我们假设您要整理表单,以便按此顺序和这些标题获得回复
时间戳,ManagerName,客户名称,电话,EmailAddress的,
function hookMeUpToFormSubmitTrigger(e)
{
var managerEmail={Brad:'email1@xxx.com',Eric:'email2@xxy.com'};//Could be drawn from contact sheets
var contactTime=Utilities.formatDate(new Date(e.namedValue.TimeStamp), Session.getScriptTimeZone(), "E MMM d, HHmm");
MailApp.sendEmail({to: managerEmail[e.namedValues.ManagerName],subect: 'New Customer: ' + e.namedValues.CustomerName,htmlBody: 'Just letting you know that ' + e.namedValues.CustomerName + ' called at ' + contactTime + ' They would like a call back at your ealiest convenient time. Their phone number is ' + e.namedValues.Phone + ' and their email address is ' + e.namedValues.EmailAddress + '.' });
}
答案 1 :(得分:0)
您需要在下拉列表中添加电子邮件ID。然后,您需要创建表单绑定脚本,然后添加下面的脚本。完成后,您需要在提交表单时安排以下功能的触发器。
function collectResponse(e) {
try {
var itemResponses = e.response.getItemResponses();
var emailAddress = itemResponses[0].getResponse(); //change the index to match your email address dropdown
var customerInfo = itemResponses[1].getResponse(); //change the index to match your customer info input box
MailApp.sendEmail({
to: emailAddress,
subject: "New customer " + customerInfo,
//body: add if you want to send more details
})
} catch (e) {
Logger.log(e)
}
}