Let's say you wanted to send an email from a SuiteScript and also wanted it to use an email template for ease of use and styling purposes. However, you need some of the values in the email to be defined or calculated by the script at the time of sending.
Using handlebars is a good way of setting a whole bunch of values relatively easily. Follow along with this article to replicate a similar use of handlebars for your use case!
Note: The steps below don’t necessarily need to be done in this order.
You can download it from here:
Then, upload it to the file cabinet and put it in a logical folder location, not just floating helplessly in the great void of the SuiteScripts folder, like an unmoored specter upon the waves of a metaphysical ocean of existential questioning.
You’ll want to change the file location in your script definition based on where you actually place and name the handlebars file in the file cabinet. See the code example below:
Next, you will need to create the email template in NetSuite using handlebars variables/placeholders.
The format here is “{{variableNameHere}}”
You can use handlebars logic too, as shown in the screenshot in the form of: {{#if variableThatMightBeTrue}} Some words here {{/if}
We like to update our blogs and articles to make sure they help resolve any troubleshooting difficulties you are having. Sometimes, there is a related feature to enable or a field to fill out that we miss during the instructions. If this article didn't resolve the issue, please use the chat and let us know so that we can update this article!
If you have questions about how our team can support your business as you implement NetSuite or SuiteCommerce, feel free to contact us anytime. Anchor Group is a certified Oracle NetSuite Alliance Partner and Commerce Partner equipped to handle all kinds of NetSuite and SuiteCommerce projects, large or small!
Tagged with Training, Troubleshooting