Version: eXtendFiles all versions
Audience: Administrator, Developer

Overview

NetSuite email templates provide a powerful way to automate and streamline your email communication with customers and other stakeholders. One feature of email templates is the ability to include URLs/hyperlinks, which can be used to provide links to important resources or to direct recipients to specific records or files.

When combined with custom fields and eXtendFiles, your email communications can include dynamic links to files hosted with eXtendFiles.

Configuration and Samples

Body Level References

When using eXtendFiles-enabled custom fields, public upload links, or approval links at the body level of a record or transaction, the URLs of those files can be sourced into email templates. This allows a link to be displayed as a button, or an image (if it is in a browser renderable format) to be rendered directly within the email template. 

The following sample use cases provide some examples of the requirements for setup and use.

Customer Public Upload Sample

When using eXtendFiles' public upload functionality, you can automatically include your public upload link in a particular email template. This streamlines the process of sending a public upload link to your customers and allows for a standardized email template to be used. To learn more about public upload links, visit Using the eXtendFiles Public Upload Feature.

Requirements:
1. Public Upload functionality is configured on your Customer record.
2. A Public Upload link has been generated for your Customer.
3. You know the NetSuite internal id for your Public Upload Link field.

In the example below, the 'document upload link' is the public upload link field on the customer record in NetSuite.

Sample email template:
Image Placeholder

Sample email template code:
<style type="text/css">
  .footer{
text-align:right;
  }
  h2, h3, h4 {
      font-weight: 600;
  }
</style>
<div style="background-color:#e8e8e8;  margin:0 auto; padding:30px;font-family: 'Montserrat', sans-serif; font-weight: 400; font-size: 14px;">
<div class="header" style="max-width:700px; margin:0 auto; padding:30px; background-color:#fff; font-family: 'Montserrat', sans-serif; ">
<div style="margin:0 ; text-align:left;"><img alt="" src="https://extendcorp.s3-us-west-2.amazonaws.com/webapproval/logos/TSTDRV1739050-PRODUCTION/logo.png" width="200" /></div>

<p>&nbsp;</p>

<h4 style="text-align:left; line-height:18px;">Hello<span style="font-family: 'Montserrat', sans-serif; background-color: rgb(255, 255, 255);">,</span></h4>

<p>In order for us to establish you confirm you as a tax-exempt customer in&nbsp;our system to properly process your order(s), we request that you provide us with a copy of your tax exempt certificate.</p>
<br />
You can electronically upload a copy of your tax exempt certificate via <a href="${entity.custentity_extend_public_upload_link}" style="color:#f36f21">this document upload link</a>.<br />
&nbsp;
<div style="padding-top: 0; text-align: center;">
<p style="background-color:#f36f21;color:#fff;font-size: 110%;font-weight: 600;padding: 5px;">
***To avoid delays in the processing of your order(s), please provide us with your tax exempt certificate&nbsp;at your earliest convenience***
</p>
</div>

<div style="padding-top: 20px;">
If you have any questions or concerns, please don&#39;t hesitate to contact us.<br />
<br />
Thank you,<br />
<br />
Timeline Promo Accounting Team
</div>

<p>&nbsp;</p>
</div>
</div>

Sales Order Body Field Sample

You can reference an eXtendFiles record in a transaction body field using NetSuite's custom fields functionality. This allows you to insert different file images or download links into your email templates by defining eXtendFiles record references on the transaction body.

Requirements:
1. A eXtendFile record has been added in a transaction body field on your Sales Order.
2. You know the NetSuite internal id for your field.

In the example below, the logo in the email template is rendered based on a reference to an eXtendFiles field that has been populated on the Sales Order.

Sample email template:
Image Placeholder

Sample email template code:
    .header {
      background-repeat: no-repeat,no-repeat;
      background-size: 100% ,100% ;
      background-position: top,bottom;
      font-family: 'Montserrat', sans-serif;
  }
    .footer{
      text-align:right;
    }
   
  #approveButton {
    background:linear-gradient(to bottom, #0c5e82 5%, #5cbf2a 100%);
    background-color:#0c5e82;
    border:1px solid #0c5e82;
    display:inline-block;
    color:#ffffff;
    font-family: 'Montserrat', sans-serif;
    font-weight:400;
    box-shadow:inset 0px 1px 0px 0px #9acc85;
  font-size:13px;
  padding:10px 12px;
  text-decoration:none; float:left; }
 
  #rejectButton {
  box-shadow:inset 0px 1px 0px 0px #cf866c;
    background:linear-gradient(to bottom, #f36f21 5%, #fa2819 100%);
    background-color:#f36f21;
    border:1px solid #f36f21 ;
    display:inline-block;
    color:#ffffff;
    display:inline-block;
    cursor:pointer;
    font-size:13px;
    font-family: 'Montserrat', sans-serif;
    padding:10px 10px;
    text-decoration:none;
    float:right;}
  .approval{width:60%;}
  h4, h3{
      font-weight: 600;
  }
</style>
<div style="background-color:#535252;  margin:0 auto; padding:30px;">
<div class="header" style="max-width:700px; min-height:450px;margin:0 auto; padding:30px; background-color:#fff; font-family: 'Montserrat', sans-serif; ">
<div style="margin:0 ; text-align:left;"><img alt="" src="https://extendcorp.s3-us-west-2.amazonaws.com/webapproval/logos/TSTDRV1739050-PRODUCTION/logo.png" width="250" /></div>

<hr style="background-color:#f36f21;height:3px; color:#f36f21; border:none;" />
<h3 style="text-align:left; line-height:14px;"><br />
<span style="font-family: 'Montserrat', sans-serif;">Hello ${customer.firstName}!</span></h3>

<p style="text-align:left;"><span style="font-size:14px;"><span style="font-family: 'Montserrat', sans-serif;">Thank you for your order!<br />
<br />
Please review the attached Sales Order and logo below and make sure we&rsquo;re both on the same page.&nbsp;If you agree that the order is correct, please click &quot;Yes&quot; on this email or the attached document.<br />
<br />
If anything looks incorrect, please click &quot;No&quot; on this email or on the attached document, and let us know the issue in the comments. We will act quickly upon notification of your feedback.<br />
<br />
Thank you for your support.</span></span></p>
<img src="${transaction.custbody_extend_files_aut_records.custrecord_extfile_link}" height="250px" width="250px"/>
<span style="font-family: 'Montserrat', sans-serif;"><#if transaction.custbody_extend_web_approval_url?has_content></span>

<hr />
<div class="approval">
<h3><span style="font-family: 'Montserrat', sans-serif;">Do you approve this order?</span></h3>
<span style="font-family: 'Montserrat', sans-serif;"><!--[if mso]>
      <v:roundrect xmlns:v="urn:schemas-microsoft-com:vml" xmlns:w="urn:schemas-microsoft-com:office:word" href="${transaction.custbody_extend_webaprvl_url}${transaction.entity}" style="height:40px;v-text-anchor:middle;width:100px;" arcsize="10%" strokecolor="#0c5e82" fillcolor="#0c5e82">
        <w:anchorlock/>
        <center style="color:#ffffff;font-family:sans-serif;font-size:13px;font-weight: 400;">YES</center>
      </v:roundrect>
    <![endif]--><a href="${transaction.custbody_extend_webaprvl_url}${transaction.entity}" style="background-color:#0c5e82;border:1px solid #0c5e82;border-radius:4px;color:#ffffff;display:inline-block;font-family:sans-serif;font-size:13px;font-weight: 400;line-height:40px;text-align:center;text-decoration:none;width:100px;-webkit-text-size-adjust:none;mso-hide:all;">YES</a> <!--[if mso]>
      <v:roundrect xmlns:v="urn:schemas-microsoft-com:vml" xmlns:w="urn:schemas-microsoft-com:office:word" href="${transaction.custbody_extend_web_apprvl_rej_url}${transaction.entity}" style="height:40px;v-text-anchor:middle;width:100px;" arcsize="10%" strokecolor="#f36f21 " fillcolor="#f36f21">
        <w:anchorlock/>
        <center style="color:#ffffff;font-family:sans-serif;font-size:13px;font-weight: 400;">NO</center>
      </v:roundrect>
    <![endif]-->&nbsp; &nbsp;<a href="${transaction.custbody_extend_web_apprvl_rej_url}${transaction.entity}" style="background-color:#f36f21;border:1px solid #f36f21 ;border-radius:4px;color:#ffffff;display:inline-block;font-family:sans-serif;font-size:13px;font-weight: 400;line-height:40px;text-align:center;text-decoration:none;width:100px;-webkit-text-size-adjust:none;mso-hide:all;">NO</a></span></div>
<span style="font-family: 'Montserrat', sans-serif;"></#if></span>

<div style="height:30px;">&nbsp;</div>

<p style="margin-top:20px;"><br />
<span style="font-size:14px;"><span style="font-family: 'Montserrat', sans-serif;">Proofs for this order will be sent separately for your approval.</span></span></p>

<p><span style="font-family: 'Montserrat', sans-serif;font-size:14px;">Thanks!<br />
Timeline Promo Marketing Team</span></p>

<h4 style="text-align:left; line-height:18px;">&nbsp;</h4>

${companyinformation.mainaddress_text}</div>
</div>
</div>

Line Level References

When using eXtendFiles-enabled custom transaction column fields at the line level of a record or transaction, those URLs can be included in email templates. For example, a link can be displayed as a button, or an image (if in a browser renderable format) can be directly rendered within the email template. Download links can also be added within a line level context.

The following sample use cases provide an example of the setup and requirements for use.

Sales Order Line Level Sample

An eXtendFiles record can be referenced in a transaction column field using NetSuite's custom fields functionality. This allows you to insert different buttons, images, or download links into your email templates at the line level by defining eXtendFiles records on the line of a transaction and sourcing their links into an additional line.

Requirements:
1. A hyperlink field has been added to a transaction column in your Sales Order. Alternatively, you can add an eXtendFiles field as a transaction column and have a second transaction column field automatically source the URL of the file into it.
2. You know the NetSuite internal id for your hyperlink field.

In the example below, some Sales Order lines have a hyperlink associated with them. When this link is present, it is rendered as a 'Download Original Art' link in the email template.

Sample email template:
Image Placeholder

Sample email template code:
    .header {
      background-repeat: no-repeat,no-repeat;
      background-size: 100% ,100% ;
      background-position: top,bottom;
      font-family: 'Montserrat', sans-serif;
  }
    .footer{
      text-align:right;
    }
   
  #approveButton {
    background:linear-gradient(to bottom, #0c5e82 5%, #5cbf2a 100%);
    background-color:#0c5e82;
    border:1px solid #0c5e82;
    display:inline-block;
    color:#ffffff;
    font-family: 'Montserrat', sans-serif;
    font-weight:400;
    box-shadow:inset 0px 1px 0px 0px #9acc85;
  font-size:13px;
  padding:10px 12px;
  text-decoration:none; float:left; }
 
  #rejectButton {
  box-shadow:inset 0px 1px 0px 0px #cf866c;
    background:linear-gradient(to bottom, #f36f21 5%, #fa2819 100%);
    background-color:#f36f21;
    border:1px solid #f36f21 ;
    display:inline-block;
    color:#ffffff;
    display:inline-block;
    cursor:pointer;
    font-size:13px;
    font-family: 'Montserrat', sans-serif;
    padding:10px 10px;
    text-decoration:none;
    float:right;}
  .approval{width:60%;}
  h4, h3{
      font-weight: 600;
  }
</style>
<div style="background-color:#535252;  margin:0 auto; padding:30px;">
<div class="header" style="max-width:700px; min-height:450px;margin:0 auto; padding:30px; background-color:#fff; font-family: 'Montserrat', sans-serif; ">
<div style="margin:0 ; text-align:left;"><img alt="" src="https://extendcorp.s3-us-west-2.amazonaws.com/webapproval/logos/TSTDRV1739050-PRODUCTION/logo.png" width="250" /></div>

<hr style="background-color:#f36f21;height:3px; color:#f36f21; border:none;" />
<h3 style="text-align:left; line-height:14px;"><br />
<span style="font-family: 'Montserrat', sans-serif;">Hello ${customer.firstName}!</span></h3>

<p style="text-align:left;"><span style="font-size:14px;"><span style="font-family: 'Montserrat', sans-serif;">Thank you for your order!<br />
<br />
Please review the attached Sales Order and make sure we&rsquo;re both on the same page.&nbsp;If you agree that the order is correct, please click &quot;Yes&quot; on this email or the attached document.<br />
<br />
If anything looks incorrect, please click &quot;No&quot; on this email or on the attached document, and let us know the issue in the comments. We will act quickly upon notification of your feedback.<br />
<br />
Thank you for your support.</span></span></p>
<#if transaction.item?has_content>

<table align="center" border="1" cellpadding="2" cellspacing="0" style="width: 100%;font-family:arial,helvetica,sans-serif;font-size:14px">
<thead>
  <tr>
  <th>Item Name</th>
  <th>Item Description</th>
  <th>eXtendFiles Reference</th>
  </tr>
</thead>
<#list transaction.item as listItem>
<tbody>
  <tr>
  <td>${listItem.item}</td>
  <td>${listItem.description}</td>
  <td style="text-align: center;"><#if listItem.custcol_extend_originalart?has_content><a href="${listItem.custcol_extend_originalart}">Download Original Art</a></#if></td>
  </tr>
  </#list>
</tbody>
</table>
</#if><span style="font-family: 'Montserrat', sans-serif;"><#if transaction.custbody_extend_web_approval_url?has_content></span>

<hr />
<div class="approval">
<h3><span style="font-family: 'Montserrat', sans-serif;">Do you approve this order?</span></h3>
<span style="font-family: 'Montserrat', sans-serif;"><!--[if mso]>
      <v:roundrect xmlns:v="urn:schemas-microsoft-com:vml" xmlns:w="urn:schemas-microsoft-com:office:word" href="${transaction.custbody_extend_webaprvl_url}${transaction.entity}" style="height:40px;v-text-anchor:middle;width:100px;" arcsize="10%" strokecolor="#0c5e82" fillcolor="#0c5e82">
        <w:anchorlock/>
        <center style="color:#ffffff;font-family:sans-serif;font-size:13px;font-weight: 400;">YES</center>
      </v:roundrect>
    <![endif]--><a href="${transaction.custbody_extend_webaprvl_url}${transaction.entity}" style="background-color:#0c5e82;border:1px solid #0c5e82;border-radius:4px;color:#ffffff;display:inline-block;font-family:sans-serif;font-size:13px;font-weight: 400;line-height:40px;text-align:center;text-decoration:none;width:100px;-webkit-text-size-adjust:none;mso-hide:all;">YES</a> <!--[if mso]>
      <v:roundrect xmlns:v="urn:schemas-microsoft-com:vml" xmlns:w="urn:schemas-microsoft-com:office:word" href="${transaction.custbody_extend_web_apprvl_rej_url}${transaction.entity}" style="height:40px;v-text-anchor:middle;width:100px;" arcsize="10%" strokecolor="#f36f21 " fillcolor="#f36f21">
        <w:anchorlock/>
        <center style="color:#ffffff;font-family:sans-serif;font-size:13px;font-weight: 400;">NO</center>
      </v:roundrect>
    <![endif]-->&nbsp; &nbsp;<a href="${transaction.custbody_extend_web_apprvl_rej_url}${transaction.entity}" style="background-color:#f36f21;border:1px solid #f36f21 ;border-radius:4px;color:#ffffff;display:inline-block;font-family:sans-serif;font-size:13px;font-weight: 400;line-height:40px;text-align:center;text-decoration:none;width:100px;-webkit-text-size-adjust:none;mso-hide:all;">NO</a></span></div>
<span style="font-family: 'Montserrat', sans-serif;"></#if></span>

<div style="height:30px;">&nbsp;</div>

<p style="margin-top:20px;"><br />
<span style="font-size:14px;"><span style="font-family: 'Montserrat', sans-serif;">Proofs for this order will be sent separately for your approval.</span></span></p>

<p><span style="font-family: 'Montserrat', sans-serif;font-size:14px;">Thanks!<br />
Timeline Promo Marketing Team</span></p>

<h4 style="text-align:left; line-height:18px;">&nbsp;</h4>

${companyinformation.mainaddress_text}</div>
</div>
</div>

Note: The URL which you are wanting to show in your email template must be either a free-form text field or a hyperlink field. NetSuite email templates are limited to the information available on the line level and cannot join to record references.

For example:
1. If you have a URL field on your line, that can be shown in an email template.
2. If you have an eXtendFiles record field on your line, the URL associated with that record cannot be displayed in an email template because NetSuite cannot perform the join into that record. Instead, the URL should be sourced from the record reference into a second field on the line so that a join is not needed.

FAQ

How can I use eXtendFiles with NetSuite email templates?

When combined with custom fields and eXtendFiles, your email communications can include dynamic links to files hosted with eXtendFiles. You can use eXtendFiles-enabled custom fields, public upload links, or approval links at the body or line level of a record or transaction. Note: approval links are available in eXtendFiles - Collaboration Edition.

What are some sample use cases for eXtendFiles with NetSuite email templates?

Some sample use cases include:

  • Including a link to a public upload page in a particular email template.
  • Inserting different file images or download links into your email templates when defining eXtendFiles record references on the body of a record.
  • Sourcing URLs at the line level of a record or transaction to show as a button, image, or download link in an email template.

Are there any requirements for using eXtendFiles with NetSuite email templates?

Yes, there are requirements for using eXtendFiles with NetSuite email templates, such as configuring public upload functionality on your target record type or adding an eXtendFiles record and hyperlink as  transaction column fields. Additionally, some approval-related operations require eXtendFiles - Collaboration Edition.

What are some limitations of using NetSuite email templates with eXtendFiles at the line level?

NetSuite email templates are limited to the information available on the line level and cannot join to record references. For example, if you have an eXtendFiles record field on your line, the URL associated with that record cannot be shown in an email template as NetSuite cannot perform the join into that record. The URL would need to be sourced from the record reference into a second field on the line so that a join is not needed.

I've included eXtendFiles links in my email templates, but my users receive 'Access Denied' (or similar) error messages when accessing the links.

For the file to be accessible, the file will need to be set as a public file (and not a private file) and the appropriate link will need to be included in your email template. Accessible URLs present on eXtendFiles record

I've used the sample email templates above, but it doesn't look the same when I view the email.

Depending on the web browser, email client, and operating system/device used, different rendering functions may or may not be available. The samples above are included as a rough guide, but most often email templates need to be tailored to your environment.

In my email templates there is link text showing even though no eXtendFile or URL is present in the associated field

As part of the email template building process, fields should be checked using Freemarker if, else, elseif  syntax to confirm if a field has a value prior to showing it.

I'm trying to show an image in my email template, but the image is not rendering.

There may be multiple reasons for this, but one thing to check is if the link/image that you are trying to render can be natively rendered by your web browser.

How can I create or modify an email template?

Email templates are created and modified using NetSuite's Email Template functionality.

I've created one of the emails templates above for public uploads using the sample template, but the public upload link isn't working.

Depending on your NetSuite configuration, public upload links may not generate automatically, or they may store their value in a different field than these sample templates. See Configuring the Public Upload Feature in eXtendFiles to determine which field is used for storing the public upload link on the record type which you are working with, and Enable Public Upload Links with eXtendFiles for an example of enabling a record with its public upload link.