Customize the Email Message Template

Customize the default mtxSubscriberOfferPurchaseNotification.ftl FreeMarker template to add the group balance information.

Before you begin

You must first create the default notification template directory. For information about creating the default notification template directory, see the discussion about creating the notification template directory.

About this task

When formatting a notification message, the Notification Server first checks if there is a custom template for a specific notification type in the /opt/mtx/notifier/templates directory. If a custom template exists in that directory, it is used. Otherwise, the default notification template included with the Notification Server is used.

Procedure

  1. Copy the /opt/mtx/notifier/templates/email/mtxSubscriberOfferPurchaseNotification.ftl file to a backup directory.
  2. Edit /opt/mtx/notifier/templates/email/mtxSubscriberOfferPurchaseNotification.ftl with a text editor and add the following code to include the group balance information (balance name, unit, and amount) in the message.
    <#list body.sampleBalanceArray as balance>
    			 Name: ${balance.Name} QuantityUnit: ${balance.QuantityUnit} Amount:
    			 ${balance.Amount} </#list>
  3. Save the file.

What to do next

Test the notification enhancements.