Skip to main content

Context Changes in E-Mails

Overview

In email messages, you can change the context of the template according to the To field.

Context changes in emails apply to one-to-many relationships when the To field contains a collection of email addresses.

When there is a one-to-many relationship between two entities, an attribute is automatically created in the Collection Entity (many) relating it to the Parent Entity (one). This attribute allows access to the parent process attributes starting from the many context. Therefore, when you change the context of an email to the Many Entity, you will still be able to access information from the One Entity.

  • If the To field contains a fixed email address or is taken from a related-entity relationship in the data model, the context will always be the Process Entity.
  • If the To field contains a collection, you can choose between the Process Entity or the Many Entity as your context.

Example

Imagine you are a Wedding Planner using Bizagi to plan weddings. The image below illustrates the data model for this process. The Process Entity is Wedding, which has a one-to-many relationship with the Guests entity. Invitations are sent via email to everyone included in the Guests collection.

When addressees in the To field are obtained through related attributes (a one-to-one relationship), the message body and conditions for multiple messages will share the same context. The data is accessed starting from the Process Entity.

However, when addressees belong to a collection (e.g., Guests), you can choose the context of the message body and conditions.

  • You can type the message navigating the data model from the Process Entity (Wedding).
  • Alternatively, you can navigate the data model from the Many Entity (Guests).

When navigating from the Many Entity, there is a change of context. In this case, the context corresponds to Guests. The Wedding entity is no longer the context entity.

Context Example

The context can be used in two ways:

  1. Using contextualized information in the email body
  2. Configuring conditions when using multiple email templates

Context in the Email Body

To include specific information like the guest's name, the Groom's name, and the Bride's name, you must change the context of the message body to the Many Entity (Guests).

For example:

<Guest's name>
You are cordially invited to the wedding of
<Groom's name>
and
<Bride's name>
on Saturday afternoon
May the 2nd
at four o'clock
Thirty-five west Leicester Avenue
followed by a reception
  • Process Entity as Context: You can access the Groom's name and Bride's name using XPath. However, you cannot access a specific guest's name since it is part of the Guests collection. Using XPath to access the Guests entity would return a list of all guest names instead of a specific one.
    Process Context

  • Changing Context: Use the Context drop-down in the email configuration menu to select the Many Entity (Guests).
    Change Context

Once the context is changed to Guests, you can directly access the guest's name. To access the Groom's and Bride's names, use the relationship from Guests to the Process Entity.
Guest Context

The final email message would look like this:
Email Preview


Context in the Conditions

If you want to differentiate between male and female guests in the invitation (e.g., adding "Mr." or "Ms." before the guest's name):

  1. Check the Multiple Messages box and add a new email by clicking the last tab.
    Multiple Messages

  2. Click Set Conditions. A new window will be displayed. Since the To field contains a collection, conditions can change context using the drop-down menu.
    Set Conditions

  3. To access each guest's gender individually, change the context to Guests. Use this context to set conditions like gender-based salutations.


Note

  • Each condition can have a different context. For example, one condition (e.g., "Thank you very much") can use the Weddings context, while another email can use the Guests context.
  • Once a condition is created, its context cannot be changed.

Conditions are established from the Guests entity:
Conditions Example
Condition Details


Finalizing Email Configurations

Type the subject and body for the email addressed to female guests:
Female Guest Email

Click Save. The respective emails will look like this:
Final Emails