Using Multiple Email Data Controls in a Template

When you create an email notification template, you aren't limited to creating one template for each notification. Instead, you can use that same template for many different notifications by using multiple Email Data controls in each template. It's quite possible to use one template for all notifications associated with a process.

The keys to using a single template for multiple notification are:

  1. Divide the email template into different sections, each of which has its own Email Data control, and
  2. Determine the conditions under which only one Email Data template is visible for each notification.

Process Director includes a type of section control called the Embedded Section. Unlike the Section control, the Embedded Section is hidden from the user. The trait makes it useful for creating multiple sections on a Form that may be hidden or displayed as necessary. Section controls are all container or parent controls that house individual Form controls or other content. If a section control is hidden, all of the child controls in the section are hidden as well.

By placing an Email Data control and other relevant content in each section, you can hide all of the sections except the one containing the necessary content for each notification.

Determining Section Visibility

The most important part of making a multiple-notification email template work properly is ensuring that you can create a set of conditions that results in only one valid Email Data control being active for every notification, with each notification being presented in it's own section of the template.

Obviously, different processes may require different conditions to be applied to the Visibility property of each section. One place to start, however, is setting the section to become visible based on the Running Activity Name.

In the case of the example above, the Embedded Section control has the Visibility property set in the Form Controls tab of the Form definition, so that the section is visible when the Running Activity name is "PR Assignment Notification", and is otherwise hidden. With this setting, the section, and the EmailData control it contains will only be visible when the notification is sent from the "PR Assignment Notification" task.

Other conditions might be applied for various circumstances, such as when the email is sent to a particular type of participant (like a manager), or when a Due Date has been reached. The important thing to remember is to ensure that only one section, with one EmailData control, is visible at any given time the notification is sent.

You always have the choice, of course, to use a single email template for a notification, rather than using a single template with multiple EmailData controls. So, the question is, when should you use a particular method?

First, if it isn't possible to derive a set of conditions that ensure only one EmailData control is visible at a given time, a separate notification template will be necessary. Second, you may also have a special template for notifying managers of an event, and you may wish to have a completely separate template for making this managerial notification. In those cases, a single template isn't desirable.

Additionally if you have many different task notifications, as well as additional notifications for non-task users, you may wish to have a template for task notifications, and a separate template for non-task notifications.