After reading this article you will know:
- How to create call back actions to mail triggers
Create model and property
To create a callback email function you first have to create a datamodel where the email object will get stored. Add an "Email message" property to the model. How different actions are triggered by this property will be explained later in this article.
Create an action that is connected to the model you just created. In this example we keep it basic and add only a "Send mail" event. Now to be able to store information about the mail and make it possible to trigger callback actions, you have to select the "storage property". This property is referring to the email message property you created earlier.
It is possible to have many different kinds of actions triggered by different kind of triggers. For each trigger you can select an action. When you've selected the triggers you want to use, these triggers have to be enabled in the mail server. If you use the default Betty Blocks mail server, you can ask support to set up the triggers you need.
Select actions for triggers
Go back to the datamodel and edit the email message property. For each trigger from Mandrill an action can be selected. Note: it is important to understand that only actions can be triggered if the correct trigger is selected in Mandrill. If there is no "open event action" trigger enabled in Mandrill, the action will not be triggered.
In the picture above the "start mail" action is the action to begin the process. When the email bounces, mandrill returns a bounce trigger. In this example an action called "bounce mail" is triggered and is shown in the logs as below:
A bounce notification email can be used in situations where an end user uses the Betty Blocks application to send an email. When this user doesn't have access to the logs of the application, the user will not know if the email will be delivered or opened. With this functionality, the user can fill in an email where the bounce email will be sent to. Like this, the end user will be notified when an email is bounced.