Editing Email template file for Sales Order

For making changes in email template for sales orders, like changing item images and item options.

First we need to edit corresponding email template file.

To open the file from the Netsuite account got to Setup>Company>Email>System Email Templates

Then we can see the editing window, clicked on the below marked icon ‘div’ for viewing the code in HTML.

we can add the changes as per our requirements.

Example:

Adding a personalized image in sales order. The personalized image will be updated in the sales order record in a new column field. The existing image URL in the item options will be removed. Also update the SO template with the new column value, item URL.

solution: for this also need to make changes in the script: “PTC-235 JJ WA email Transaction column“ (script file for email template) and to bring the value of personalised image into the email template “Custom JJ Web Site Order Received“.

Code snippet: for email template.

<td style="padding-top:10px;">
                    <#assign personalize_image= false>
                    <#if (itemline.options)?has_content>
                    <#assign br="<br />">
                    <#list (itemline.options)?split(br) as option>
                    <#assign label=option?substring(0,option?index_of(":")) value=(option?substring(option?index_of(":")+1))?trim>
                    <#if (label)?has_content>
                    <#if label == "PersonalizeImageURL">
                    <#assign personalize_image= true>
                </#if></#if>
                </#list>
            </#if>
                    <#if (itemline.custcol_ptc_235_imageurl_child)?has_content>
                    <#assign imageURL=('https://'+website.domain+'/iloveblvdimages/' +itemline.custcol_ptc_235_imageurl_child+'?resizeid=2&resizeh=175&resizew=175')>
                    <#if ((personalize_image)?has_content && (personalize_image == true))>
                    <#assign imageURL=('https://iloveblvd.liquifire.com/iloveblvd?set=prodID[' + itemline.custcol_ptc_235_imageurl_child+'seed[001]&call=url[file:main]&sink')>
                    </#if>
                    <img alt="" data="customNew" src="${imageURL}" style="display: block; margin-left: auto; margin-right: auto; max-height: 64px; max-width: 64px;" />
                    <#else>
                    <#if (itemimages[itemline.item.internalId])?has_content><img alt="" data="customNew" src="${itemimages[itemline.item.internalId]}" style="display: block; margin-left: auto; margin-right: auto; max-height: 64px; max-width: 64px;" /> </#if>
            </#if>
            </td>

Leave a comment

Your email address will not be published. Required fields are marked *