I want to customize the order confirmation email generated from my company's e-commerce web site. I have searched all the files I can find within the SSP Applications folder. From where does this email originate?
-
Thank you for your answers below. I found this in the Help Center: https://system.na2.netsuite.com/app/help/helpcenter.nl?fid=section_n2609617.html. For now I will try to make the email format acceptable using this method, but will keep in mind your answers. – Melgirl Jun 22 '17 at 13:40
3 Answers
NetSuite have advised me that customizing email templates for the webstore is not possible (or 'not supported' - I forget the exact words used) at present, however you can work around this by turning off the emails in the email tab of the Setup Web Site page, and then creating your own using workflows. You can add a condition on the workflow to only act on sales orders with a Source field equal to whatever the source is on your web orders (typically 'Web ({sitename})'). From my experience you need to add the whole string to the condition, not just 'Web' as it appears on saved searches.
Hope this helps - let me know if you need more details.

- 4,394
- 2
- 9
- 13
-
No need of workflow, you can use User event for details see my answer. – Anup Chaudhary Jun 22 '17 at 04:52
-
True, but I think most would consider setting up a workflow easier and quicker than delving into scripting. – Krypton Jun 22 '17 at 12:05
-
You can customize order email in netsuite Suitecommerce Site, Yes your are write that you can not find default template used for order email, But With User Event you can trigger customized order email.
You need to create user event on 'AFTER SUBMIT FUNCTION' and it should be Applied to Sales Order
Below is some example SuiteScript you can use, We have doneorder confirmation email throught User event and it is working perfectly fine for us. This is the only way you can customize emaiil
`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);
}
`
Note: 18 in nlapiSendEmail() is the customer's id, you need to create customer from his email id this will get triggered.
Let me know for more information.

- 320
- 1
- 10
It depends if you are using a Basic Printing Type or Advanced Printing Type. I just did changes on my order confirmation recently.

- 65
- 1
- 6