我想自定义从我公司的电子商务网站生成的订单确认电子邮件。我已经搜索了在SSP应用程序文件夹中可以找到的所有文件。这封电子邮件来自哪里?
发布于 2017-06-22 03:51:34
NetSuite建议我,自定义电子邮件模板的网络商店是不可能的(或“不支持”-我忘记了确切的词语使用),但您可以解决这个问题,关闭电子邮件标签中的电子邮件设置网站页面,然后创建您自己的使用工作流程。您可以在工作流中添加一个条件,以便仅对其来源字段等于web订单上的任何来源(通常为'Web ({sitename})')的销售订单执行操作。根据我的经验,您需要将整个字符串添加到条件中,而不仅仅是保存的搜索中显示的“Web”。
希望这对你有所帮助-如果你需要更多细节,请告诉我。
发布于 2017-06-22 12:50:51
您需要在“提交后函数”上创建用户事件,并将其应用于Sales Order
下面是一些你可以使用的示例SuiteScript,我们已经通过用户事件完成了订单确认电子邮件,它对我们来说工作得很好。这是您自定义电子邮件的唯一方法
`var CONTEXT = nlapiGetContext(); //get the current context
var executeScript = true;
function OrderConfirmEmail()
{
nlapiLogExecution('DEBUG', 'Process Error', "hi");
var stExecType = CONTEXT.getExecutionContext();
if(stExecType != 'webstore')
{
try
{
return true;
}
catch(e)
{
nlapiLogExecution('ERROR', 'e', e);
return true;
}
}
try
{
var orderid = nlapiGetRecordId();
var order = nlapiLoadRecord('salesorder',orderid);
var detail = getOrderDetail(order);
if(detail.tranid == null)
{
var order = nlapiLoadRecord('salesorder',orderid);
detail = getOrderDetail(order);
SendEmail(detail);
}
else
{
SendEmail(detail);
}
}
catch(error)
{
if(error.getDetails != undefined)
{
nlapiLogExecution('ERROR', 'Process Error', error.getCode() + ': ' + error.getDetails());
throw error;
}
else
{
nlapiLogExecution('ERROR', 'Unexpected Error', error.toString());
throw error;
}
}
}
function SendEmail(detail)
{
var htmltext = '';
htmltext = htmltext + getHead(detail.entity);
htmltext = htmltext + getTemplateHeader(detail.entity);
htmltext = htmltext + getStatus(detail.tranid,detail.entity);
htmltext = htmltext + getOredrInformation(detail,detail.entity);
htmltext = htmltext + getShippingDetail(detail,detail.entity);
htmltext = htmltext + getOrderDetailEN(detail);
htmltext = htmltext + SuggestedProduct(detail.entity);
htmltext = htmltext + thankYouMessage(detail.entity);
htmltext = htmltext + services(detail.entity);
htmltext = htmltext + getTemplateFooter(detail.entity);
htmltext = htmltext + getTemplateFoot(detail.entity);
nlapiSendEmail('18', detail.email, 'Order Confirmation Email', htmltext);
}`
注意: nlapiSendEmail()中的 18是客户的id,您需要从他的电子邮件id创建客户,这将被触发。
有关更多信息,请让我知道。
发布于 2017-06-23 01:34:09
这取决于您使用的是基本打印类型还是高级打印类型。我最近刚刚更改了我的订单确认。
https://stackoverflow.com/questions/44684383
复制相似问题