Records and Fields Available in Website Email Templates
The following table lists all the records and synthetic fields that are supported in the Text Editor field on the System Email Templates page and in template files you create and attach there. In addition to the synthetic fields, you can also use the standard record fields belonging to the listed records. System email templates use the same record, field, and sublist IDs that are used in SuiteScript. Refer to the SuiteScript Records Browser for a complete list of these IDs. For more information about the sublists and synthetic fields supported for website system email templates see Web Site Notification Fields.
Record |
Field |
Available for Email Type |
---|---|---|
Web Site |
customerCenterUrl |
|
url |
||
domain |
||
downloadLink |
|
|
recoveryPasswordUrl |
Password Recovery |
|
errorTicket |
Checkout Errors |
|
cartContents |
||
Sales Order |
trackingLink |
|
overviewTable |
||
itemAvailabilities This field can be used to calculate whether an item is out of stock. The calculation to obtain this information depends on how you have set up the ordering workflow in NetSuite. See Include Out of Stock Information in Website Email for more information. |
||
licenses |
License Code |
|
Cash Sale |
licenses |
License Code |
Item Fulfilment |
trackingLink |
Order Fulfilled |
overviewTable |
The following synthetic fields are not associated with a record but are available for use in website email templates:
Field |
Usage |
Available for Email Type |
---|---|---|
itemurls |
Provides the URL of the item detail page. Usage format:
|
|
itemimages |
Provides the URL of the item image. Usage format:
|
When you use either of these fields, replace item.internalId
with a valid item internal ID from your NetSuite account. This could be in the form of a constant number or a field containing the internal ID of the item, for example, itemline.item.internalId
. For a usage example, see the Standard Web Site Order Received email template.
Include Out of Stock Information in Website Email
The itemAvailabilities
synthetic field contains the number of items available for sale, taking into consideration items in warehouses minus items already committed to other orders. The exact formula to calculate whether an item is out of stock depends on how you have set up the ordering workflow in NetSuite. For example, it is possible to use scripts and custom workflows to change the point in the ordering process at which an order is fulfilled, thus affecting the items available in the warehouse. If your setup allows items to be set to ‘backordered’, this also affects the number of items available. Therefore, you should evaluate your workflows to determine how to use itemAvailabilities
to calculate whether an item is out of stock. You can use the result of the calculation in an email template to display whether the item is out of stock or not.
itemAvailabilities
applies only to inventory items, kits, and assembly items.
The following are some sample formulas that could be used to calculate whether an item is out of stock:
Workflow in which order needs to be approved after it is placed
<#if (itemAvailabilities[itemline.item.internalId])?has_content && (itemAvailabilities[itemline.item.internalId]?number - itemline.quantity <0)>
This item is currently out of stock and may be back ordered.
</#if>
Workflow in which order is approved immediately after it is placed
<#if (salesorder.status == 'Pending Approval')>
<#if (itemAvailabilities[itemline.item.internalId])?has_content && (itemAvailabilities[itemline.item.internalId]?number - itemline.quantity <0)>
This item is currently out of stock and may be back ordered.
</#if>
<#elseif (salesorder.status == 'Pending Fulfillment')>
<#if (itemline.backordered?number gte 0)>
This item is currently out of stock and was back ordered.
</#if>
</#if>