Email Templates

You can configure MYOB Advanced to automatically send template-based emails to users on different occasions. For example, a new user may receive an email with the user credentials to be used to access the system, or a user can receive a notification that a document has been approved and needs further processing. Also, you can use template-based emails in mass mailings. For an example of a notification template for notifications about changes in case contents made through the Customer Portal, see To Add a Notification Template for Changes in the Contents of a Case.

In addition to the standard set of templates that comes with MYOB Advanced, you can create new templates for notifications or emails by using the Email Templates (SM204003) form. On the Email Preferences (SM204001) form, you can set the default templates for welcoming new users and for helping users with sign-in and password recovery.

Tip: You can create notification templates directly from a data entry form. You open the entry form and select Tools > Notifications on the form title bar. For details, see Business Events: Use of a Data Entry Form as a Source.

Using Placeholders in Email Templates

To specify the recipients of the emails, you can use the data fields (as the placeholders, separated with semicolons) that hold email addresses and whose values are retrieved when the system sends the email. For the To, CC, and BCC boxes, you can specify an email address as follows:

  • A specific user in the system whom you add by double-clicking the username in the Users folder, which is available in the lookup box. The system adds it as EMAIL((<username>));.
  • A specific email address that you manually type in the box, such as sales@acumatica.com.
  • A placeholder for an email address stored in the system, which you add by double-clicking the corresponding database field in the Entity folder, which is available in the lookup box. The contents of the folder are provided by the data entry form or generic inquiry form selected in the Screen Name box of the form, for example, ((customer.DefContactID.EMail)).

In the body of the email template (on the Message tab), you can click Insert Data Field on the formatting toolbar to insert as a placeholder any data field provided by the data entry form or generic inquiry form selected in the Screen Name box of the form.

For email templates used as subscribers of business events, you can click Insert Previous Data Field on the formatting toolbar to insert as a placeholder any data field whose value was retrieved before the business event occurred. You can use this ability to demonstrate how the value of the data field has changed—for example, if a case status has changed from New to Open.

Tip: Any template that you want to use as a user welcome template must have four placeholders apecified in the following order: ((Company)), ((Name)), ((Username)), and ((Password)). To see an example, view the User Welcome Notification template, which is the default template to welcome new users to MYOB Advanced.

Including Document Details

You can include information from document detail lines in notifications. If you want to simply list document details, you add the foreach view="view_name" loop to the body of the notification template in the HTML format. For instance, you can use the following construction for notifications about opportunities.

<foreach view="Products"> 
    ((Products.InventoryID)) - ((Products.Quantity)) - ((Products.CuryExtPrice)) <br> 
</foreach>

If you want to list details in a table or as a numbered or unordered list, you can use the data-foreach-view="view_name" attribute. The attribute indicates that the markup that is embedded inside the tag will be repeated for all document lines, as shown in the following example for notifications about opportunities. The attribute is supported for the following HTML tags: <tr>, <td>, <li>, and <div>. In the following example, when the email content is generated, all tags included in the <table> tag are repeated for every record in the "Products" view.

<table border="1" >
	<tbody>
		<tr data-foreach-view="Products" >                    
			<td class="warncell">((Products.InventoryID)) </td>
			<td class="warncell">((Products.Quantity)) </td>
			<td class="warncell">((Products.CuryExtPrice)) </td>
		</tr>
	</tbody>
</table>
Attention: You can use the "data-foreach-view" and foreach attributes in the notification templates used for business events, but leave empty the view name in the attribute: <tr data-foreach-view=""> or foreach view="". If you specify the view name in this attribute, the system will insert the values of only the first record in the email.