Capturing Message Details from a Message Run for Use in a Process Flow
Aptify includes two global events (the BeforeSendMessage and AfterSendMessage Event Definitions) that capture information when a message is sent out by Aptify's Message Engine. Using these events, you can pass message details into a process flow as needed, such as to automatically generate a Contact Log record when a message is sent.
Keep in mind that these values apply to a specific message in a Message Run. In other words, if a Message Run has four recipients, the global event is fired four times, once per recipient.
The following is the list of properties that are captured as part of the BeforeSendMessage and AfterSendMessage events. They constitute the entire set of properties available when using the BeforeSendMessage and AfterSendMessage global events and generally correspond to fields found in a Message Runs record.
- ToEmail: Email address of recipient.
- CCEmail: Email address of any carbon-copied recipients.
- BCCEmail: Email address of any blind carbon-copied recipients.
- Priority: The email's assigned priority level.
- FromDisplayName: The display name for the email sender.
- FromEmail: The sender's email address.
- ReplyToEmail: The message's Reply To email address.
- Subject: The message's subject.
- TextBody: The plain text version of the message.
- HTMLBody: The HTML Body version of the message.
- EntityID: The ID of the entity from which the message was sent. That is, the Entity linked to the message run's Message Source.
- MessageDataRow: The position of this message within the Message Runs data set.
- ToType: The type of email address used for the recipient (Static or dynamic based on a Field value).
- CCType: The type of email address used for CC recipients (Static or dynamic based on a Field value).
- BCCType: The type of email address used for BCC recipients (Static or dynamic based on a Field value).
Note that when creating an Event Handler for a process flow that uses these messaging properties as Input Properties, use a Global Event Scope (which means that the process flow will fire whenever a message is sent by the Aptify Messaging Engine). In this case, the Source and Source Type information in the Event Handler Input Map populate automatically based on the Input Properties of the specified Process Flow and the Input Map grid is read-only and does not allow a user to make any changes to the global property information.
The figure below illustrates a Global Event Handler for the BeforeSendMessage event definition linked to a process flow that uses all of the available message fields as Input Properties.
Using this type of Global Event Handler, an administrator or developer can create a process flow that leverages Aptify's standard CRUD components to automatically generate Contact Log records for each message that is sent by the system. This type of process flow could include:
- A Rule-based step to obtain information not directly provided by the message fields (such as obtaining the recipient's PersonID record based on the ToEmail address).
- A Create Contact Log component step to generate a Contact Log record that passes the message's Subject and HTMLBody field to a Contact Log's Description and Details fields.
One or more Create Contact Log Links steps to generate links to Persons, Companies, and Employees for this new Contact Log record.
See How to Create a Process Pipeline for information on how to create process flows and define event handlers.
Copyright © 2014-2019 Aptify - Confidential and Proprietary