Marketing templates typically make use of CRMSDK (Customer Relationship Management Software Development Kit) tags, which act like the tags you use when you mail merge in Microsoft Word. In NetSuite, however, a CRMSDK tag is replaced with the corresponding information from the type of record it refers to without having to create a spreadsheet of data or import or export any information. The tag can include data from custom fields on the record if needed.
For example, you create an email marketing template that begins with the following: Dear <NLENTITYID>,
The <NLENTITYID> tag is automatically replaced with the first and last name or company name of each person in the target group. Aside from relationship and employee records, you can use CRMSDK tags when sending mass email about cases, transactions, or custom records.
CRMSDK templates are about to be fully phased out in 2016.1. If you have not migrated those over to the scriptable templates and updated your scripts accordingly this is your last chance.
If you are unsure how to modify your script, please refer below.
SuiteAnswer #39908: Sample script to send an email when referencing a scriptable template using nlobjTemplateRenderer
var emailTempId = 8; // internal id of the email template
var emailTemp = nlapiLoadRecord(’emailtemplate’,emailTempId);
var emailSubj = emailTemp.getFieldValue(‘subject’);
var emailBody = emailTemp.getFieldValue(‘content’);
var records = new Object();
records[‘transaction’] = ‘2580’; //internal id of Transaction
var salesOrder = nlapiLoadRecord(‘salesorder’, 2580);
var renderer = nlapiCreateTemplateRenderer();
renderer.addRecord(‘transaction’, salesOrder );
renderSubj = renderer.renderToString();
renderBody = renderer.renderToString();
nlapiSendEmail(-5, ’email@example.com’, renderSubj, renderBody , null, null, records);
Follow the below instruction to convert a CRMSDK template to a scriptable template:
- View the CRMSDK template you want to convert.
- Click Convert to Scriptable.
- If this is an email template select the type of record the template is used for.
- A new template record is created and the name is appended with (Converted).
- Check the template to make sure all fields have been converted correctly.
- Click Save.
It is strongly recommended that you test any converted templates before using them. You can view the template in Source mode to review any fields with hidden logic after conversion.
Please note that you should convert all CRMSDK templates to scriptable prior to the 2015.2 release, but there is one exception—if a SuiteFlow workflow references a CRMSDK template, it should still work up until the 2016.1 release. At that time, conversion will be mandatory even for these templates.