Edit email templates

Tungsten AP Essentials uses email templates when sending automatic notifications. You can customize the contents of the notification emails.

Edit email templates in Admin Center

Edit an email template in Admin Center as follows:

  1. Navigate to the Email templates view.

    Different templates appear, depending on your current account level (subsidiary, partner, or customer). Templates without "template" in the name are used when a notification is triggered at the current account level. Templates that contain "template" in the name are the templates that are copied to the corresponding subaccount when you create a new subaccount.

  2. Select a template that you want to edit from the list and select Edit.
  3. Edit the Subject and Body of the email as needed. Note the variables that are available for use in the email body and subject. Different variables are available depending on the template you select. Variables relating to passwords cannot be used in the email subject.

    Optionally, you can select Enable HTML to use HTML-formatted text in the body.

  4. Select Save & close after you finish making changes.

    When saving templates for subaccounts, you are prompted to choose whether you want to:

    • Save changes to this template only – Existing templates are not changed; however, new subaccounts created after this point will use the updated template.

    • Save changes to this template and all existing [Template name] templates for all partners/customers – Existing templates of immediate subaccounts are updated with the new template. For example, suppose you edit the template named "Batch received template" on a subsidiary account. In this case, the template is updated for all partners of the current subsidiary. However, only partner templates are affected; the changes do not propagate recursively to the customer accounts.

HTML templates

Special templates

Most templates use variables in a straightforward manner when generating email notifications. In most cases, each variable represents one piece of information. For example, the "Workflow: Document assigned" template has a variable, %InvoiceNumber%, which represents the invoice number of the document specified by the email notification. However, some templates – for example, the "Workflow summary" templates – can contain information from multiple documents. You may wonder how the context of %InvoiceNumber% is determined in a template that refers to multiple documents. Because document-related variables in these templates can represent more than one document, special consideration must be taken when editing these templates.

To properly display the information from each document and provide context to the template variables, we use loops. A loop is a programming concept that can execute a block of code a number of times without writing it repeatedly. For email notifications, we output variable values in their proper context by using a loop to provide context and iterate through each document specified by the notification. Be careful not to break the loop structure when editing these templates:

  • Max duration in step reached

  • Workflow summary: Documents assigned

  • Workflow summary: Documents rejected

  • Workflow summary: Request information

In the special templates, these variables can only be used in a loop:

  • %CustomerName%
  • %TrackId%
  • %SupplierName%
  • %DueDate%
  • %GrossAmount%
  • %Currency%
  • %InvoiceNumber%

Example

Tungsten AP Essentials uses a special variable (%foreachDocument%) to designate a loop. Consider the following example from an email notification template:

<table>
	<thead>
			<tr>
				<th>Organization</th>
				<th>Track ID</th>
				<th>Supplier name</th>
				<th>Due date</th>
				<th>Amount</th>
				<th>Invoice number</th>
			</tr>
		</thead>
		<tbody>
			<tr %foreachDocument%>
				<td>%CustomerName%</td>
				<td>%TrackId%</td>
				<td>%SupplierName%</td>
				<td>%DueDate%</td>
				<td>%GrossAmount% %Currency%</td>
				<td>%InvoiceNumber%</td>
			</tr>
		</tbody>
</table>

The HTML code above displays a table. The first row contains column labels. The second row displays the values from each document specified by the notification. The %foreachDocument% variable on the TR element indicates the boundary of the loop. This means that a new row is added for each document specified by the notification, and the context of the variables changes to another document with each iteration through the loop. New rows are added until there are no more documents referenced by the notification.

%DocumentId% and %TrackId% variables in email templates

The %DocumentId% and %TrackId% variables are used to reference documents in email templates. Due to earlier implementation differences, these variables are not used consistently in all email templates:

  • In some templates, %DocumentId% returns the track ID instead of the document ID.
  • In other templates, %TrackId% is not available, even though track ID is used internally.

This behavior will be corrected in an upcoming update. To ensure consistent usage across all document-related email templates:

  • %DocumentId% will return the document ID.
  • %TrackId% will return the track ID.

The following table shows the current behavior of the variables in all email templates.

Email template

%DocumentId% behavior

%TrackId% behavior

Assigned correction workflow Works as expected. Works as expected.
Information received Works as expected. Works as expected.
Max duration in step reached Incorrectly returns the track ID. Not supported.
New supplier request Incorrectly returns the track ID. Not supported.
Post failed Incorrectly returns the track ID. Not supported.
Registration failed Incorrectly returns the track ID. Not supported.
Validation failed Incorrectly returns the track ID. Not supported.
Workflow summary: Documents assigned Works as expected. Works as expected.
Workflow summary: Documents rejected Works as expected. Works as expected.
Workflow summary: Request information Works as expected. Works as expected.
Workflow: Document assigned Works as expected. Works as expected.
Workflow: Document rejected Works as expected. Works as expected.
Workflow: Request information Works as expected. Works as expected.

Impact on existing templates

No action is required.

All existing email templates will be updated automatically as part of the change. Any incorrect usage of %DocumentId% will be corrected so that templates continue to work as expected. You can continue using existing variables as they are. If you are creating new templates, be aware that the behavior will be standardized in a future release.