Mail template commands and variables

When you create a custom mail template, make sure to include the CSS in the <style> element in the default file, AdhocDefault.xhtml. You can download the default mail template, rename it, customize it and upload your custom mail template.

The following topics lists the notification type and information variables and provide an email template variable example:

Related topics:

Notification type variables

Reference the following variables in the display property of the style attribute of an XHTML element in the mail template to select what information is included:

  • $DISPLAY_ENROLLMENT – Enrollment notification
  • $DISPLAY_DELIVERY – Delivery success or failure notification
  • $DISPLAY_PKG_INFO – Display the message information including the sender, the recipient and the message text
  • $DISPLAY_FAILURE_ENROLLMENT – Enrollment failed
  • $DISPLAY_FAILURE_FORBIDDEN – Delivery was forbidden based on the delivery method
  • $DISPLAY_FAILURE_GENERAL – General delivery failure
  • $DISPLAY_FAILURE_RECIPIENT – Delivery to the recipient failed
  • $DISPLAY_FAILURE_UNRESOLVED – The recipient could not be resolved

If the value of a variable is the empty string, the information is displayed. If the value is none, the information is not displayed.

Notification information variables

The following variables contain information used in account enrollment notifications:

  • $ENROLL_USERNAME – User name for enrollment
  • $ENROLL_PASSWORD – Password for enrollment
  • $ENROLL_LOGINURL – URL for enrollment using $ENROLL_USERNAME and $ENROLL_PASSWORD

The following variables contain information used in package delivery failure notifications:

  • $PKG_FAILURE_ENROLLMENT – Error message for an account enrollment failure
  • $PKG_FAILURE_FORBIDDEN – Error message for a forbidden delivery failure
  • $PKG_FAILURE_GENERAL – Error message for a general delivery failure
  • $PKG_FAILURE_RECIPIENT – Error message when the email cannot be delivered to a recipient
  • $PKG_FAILURE_UNRESOLVED – Error message when an account cannot be resolved
  • $PKG_TO – Recipients from the TO list
  • $PKG_CC – Recipients from the CC list
  • $PKG_BODY – Text of the message
  • $PKG_ATTACHMENTS – Names of the files attached to the message

Additional attributes

Additional attribute user variables (userVars) are defined per account or account template in the Additional Attributes pane. For additional account creation information, refer to Create a user account. For additional account template creation information, refer to Add an account template.

To use userVars for email notifications, you must create your own mail template and specify the desired value with following expression:

$DXAGENT_ACCOUNT_ATTR_USERVARS_{KEY}

Where KEY is the additional attribute key.

For example, if you want an user name defined in the Additional Attributes you must type:

$DXAGENT_ACCOUNT_ATTR_USERVARS_NAME

If the key of an additional attribute contains periods (.) in its name you must replace this all occurrences of periods with underscores (_), when using this attribute in email template.

For example:

To use userVars.name.first in an email template you must type:

$DXAGENT_ACCOUNT_ATTR_USERVARS_NAME_FIRST

If there is collision between Additional Attributes keys after they are used for email template notifications, the value to which they will be evaluated in email template is not determined.

For example:

userVars.name_first and userVars.name.first are both used as:

$DXAGENT_ACCOUNT_ATTR_USERVARS_NAME_FIRST

It is not clear to which value this expression is going to be evaluated.

Flow and subscription attributes

Flow and subscription attributes user variables (userVars) are defined per subscription in the Flow/Subscription Attributes pane. For additional subscription information, refer to Subscribe an account to an application.

To use userVars for email notifications, you must create your own mail template and specify the desired value with following expression:

$DXAGENT_SUBSCRIPTION_ATTR_USERVARS_{KEY}

Where KEY is the flow attribute key.

For example, if you want an user name defined in the Flow Attributes you must type:

$DXAGENT_SUBSCRIPTION_ATTR_USERVARS_NAME

If the key of a flow attribute contains periods (.) in its name, you must replace all periods with underscores (_) when using this attribute in email template.

For example:

To use userVars.name.first in an email template you must type:

$DXAGENT_SUBSCRIPTION_ATTR_USERVARS_NAME_FIRST

If there is collision between flow attribute keys after they are used for email template notifications, the value to which they will be evaluated in the email template is not determined.

For example:

userVars.name_first and userVars.name.first are both used as:

$DXAGENT_SUBSCRIPTION_ATTR_USERVARS_NAME_FIRST

It is not clear to which value this expression is going to be evaluated.

Email template variable example

The following example from the default email template uses a variables to select a row of a table that includes information from another variable.

<tr style="display: $DISPLAY_DELIVERY">
   <th>To</th>
   <td style="vertical-align: top;">$PKG_DELIVERY_TO</td>
</tr>

Related Links