Email Templates as XML Definitions

SuiteCloud Development Framework (SDF) supports email templates that generate personalized email messages to send to business contacts. The emailtemplate SDF custom object can be used to develop custom email templates in a SuiteCloud project. You can create new email templates, or import existing email templates from a NetSuite account into a SuiteCloud project using SuiteCloud IDE plug-in or SuiteCloud CLI.

There are two components to email templates in a SuiteCloud:

You can create email templates in an XML definition by creating both an email template SDF custom object and a template definition file.

The emailtemplate SDF custom object file name must match the scriptID attribute and requires the prefix custemailtmpl, for example custemailtmpl_quoterequest.xml. For information about the available fields for the emailtemplate SDF custom object, see emailtemplate.

Consider the following information when working with template definition files:

For information about customizing the template definition, see the following:

Email Template XML Definition Examples

The following is an example of an emailtemplate SDF custom object that defines an email template for messages confirming a quote request was received:

            <emailtemplate scriptid="custemailtmpl_quoterequest">
    <name>Reply to quote request</name>
    <recordtype>ENTITY</recordtype>
    <subject>We have received your request</subject>
    <usesmedia>F</usesmedia>
</emailtemplate> 

          

The emailtemplate SDF custom object example has the file name custemailtmpl_quoterequest.xml. The SDF custom object requires a template definition file with the file name custemailtmpl_quoterequest.template.html, which contains the HTML and FreeMarker code that defines the email template. The content of custemailtmpl_quoterequest.template.html is beyond the scope of this example.

For information about customizing email templates, see the following:

The following is an example of the same emailtemplate SDF custom object referencing the template definition file quoterequest_template.html in the File Cabinet.

            <emailtemplate scriptid="custemailtmpl_quoterequest">
    <name>Reply to quote request</name>
    <recordtype>ENTITY</recordtype>
    <subject>We have received your request</subject>
    <usesmedia>T</usesmedia>
    <mediaitem>[/Templates/E-mail Templates/quoterequest_template.html]</mediaitem>
</emailtemplate> 

          

Related Topics

Templates
Advanced HTML/PDF Templates as XML Definitions

General Notices