emailMerger.setEntity() 似乎没有将使用的模板与实体合并
emailMerger.setEntity() Seems to be not merging the used template with the entity
我正尝试在我的沙箱中向客户发送关于用户事件的模板邮件(可编写脚本),下面是我的代码:
var emailMerger = nlapiCreateEmailMerger('22');
emailMerger.setEntity('customer', customerId);
// emailMerger.setRecipient('customer', customerId);
var mergeResult = emailMerger.merge();
var emailSubject = mergeResult.getSubject();
var emailBody = mergeResult.getBody();
emailBody = emailBody.replace('{1}', name);
emailBody = emailBody.replace('{2}', date);
nlapiSendEmail('20', 'user1@mytestserver.com', 'Test Mail',emailBody, null, null, null, null);
但不幸的是,我无法在该客户的通讯选项卡下看到任何合并的邮件。我在这里遗漏了什么吗?
var obj = nlapiLoadFile(9398);
var records = new Object();
records['entity'] = '1752';
nlapiSendEmail('-5', '-5', 'emailSubject','emailBody', null, null, records, [obj]);
this will work mail and attachment will save in communication tab.
我正尝试在我的沙箱中向客户发送关于用户事件的模板邮件(可编写脚本),下面是我的代码:
var emailMerger = nlapiCreateEmailMerger('22');
emailMerger.setEntity('customer', customerId);
// emailMerger.setRecipient('customer', customerId);
var mergeResult = emailMerger.merge();
var emailSubject = mergeResult.getSubject();
var emailBody = mergeResult.getBody();
emailBody = emailBody.replace('{1}', name);
emailBody = emailBody.replace('{2}', date);
nlapiSendEmail('20', 'user1@mytestserver.com', 'Test Mail',emailBody, null, null, null, null);
但不幸的是,我无法在该客户的通讯选项卡下看到任何合并的邮件。我在这里遗漏了什么吗?
var obj = nlapiLoadFile(9398);
var records = new Object();
records['entity'] = '1752';
nlapiSendEmail('-5', '-5', 'emailSubject','emailBody', null, null, records, [obj]);
this will work mail and attachment will save in communication tab.