Learn how to automate emails for advanced scenarios using Email Templates and the "Custom" Email Template Type
Beyond the standard Email Template Types outlined in the "Create / Edit Email Templates" article, Infoplus offers the flexibility to create Email Templates with the Email Type of "Custom". These templates can be tailored for various records and scenarios beyond automated order notifications.
However, Email Templates with the Email Type of "Custom" have a more complex setup. You'll need to define the record type they'll be associated with (e.g., ASN, Item Receipt) and utilize a script to populate much of their data. For instance, you'll configure how fields like "To Address," "To Name," "CC Address," and "BCC Address" are populated, typically using script output variables.
To access Email Templates, navigate to Apps > Emails > Email Templates or use the quick action menu (period key).
ASN Example
The following example profiles a client who used custom emails to create purchase order emails to their vendors.
The use case below shows a client that used a custom template on their ASN table that is used to directly notify their vendors whenever a purchase order (ASN) is placed. This client also submitted to the support team to get their email address verified on our servers. With this being done, they are able to enter their own emails as the Ship From contacts.
In order to pull in vendor-level information, a script is used to create a vendor object that can be referenced. You can see in the screenshot above that we are calling the script output in order to set the correct send to email address. In this case, the email will be sent to the contact email set in the order email field of the vendor record.
Note: Punctuation characters are not allowed in the Vendor Name field. This field will only support alphanumeric characters. If a vendor name has a hyphen "-", for example, the user will receive a "contact support" error. Simply remove the special character and you should be able to send your custom email to this vendor.
Here is the finished result. The script and code for the body of the email can be found below.
Here is the 'Script for ASN PO Email' that makes this possible. This script also exposes vendor data as well as creates an item map so we can return all line item information in a list format.
Here is the code for the body of the email.