Creating an automatic email: Tutorial
The following example illustrates how to create an event confirmation email that will be sent when someone registers for an event.
Note: Some of the steps in this tutorial include PLUS features and additional licensing is required. For more information, contact your AiSP or ASI Technical Support.
Building the query
Create a query called Event registrations that returns event registration data, and includes all the properties that you wish to use in your email; for example, the registrant’s name and the name of the event. For more information on creating queries, see Building IQA queries: Tutorials.
- From the Staff site, go to RiSE > Intelligent Query Architect.
- Navigate to $/Common/Communications/Queries.
- Add a new query (New > Query).
- (Summary tab) Enter the name of the query as Event registrations.
- (Sources tab) Click Add Source, then select the CsRegistration and CsEvent business objects and click OK.
- Set up the relationship between the selected business objects. In the Relations drop-down, select Custom, then choose CsRegistration.Event Code Equals CsEvent.Event Code, and click the + button.
- (Filters tab) Filter the query to include only active registrations. In the Property column, select CsRegistration.Status from the drop-down. In the Comparison column select Empty. Click the + button to add the filter.
- (Display tab) Select the results you wish to be displayed in the query by choosing the columns to include in the query. In the View drop-down, select View all columns. Select the Display checkbox for the properties you wish to include in the event confirmation email. For example:
- CsRegistration.Full Name
- CsRegistration.Ship To ID (add an Alias of "PartyId")
- CsRegistration.Order Number (can be used to connect Additional Data Sources in the communication template)
- CsEvent.Title
- CsRegistration.Event Code (can be used to provide a link to the event in the email)
- CsRegistration.Total Charges
- CsRegistration.Total Payments
- CsRegistration.Balance
- CsEvent.Begin Date
- CsEvent.City
- CsEvent.State Province
- Save the query, and then click the Run tab and verify that you can view event registrations with the appropriate information.
Note: You can use the Ctrl key to select multiple business objects. Use the Quick find field to filter the list.
Creating a communication template
Create a communication template for the confirmation email that will use your Event registrations query to populate the body of the email. To create your template:
- Go to Marketing > Communication templates.
- Navigate to the Templates folder, or to the folder where you wish to add the event confirmation email.
- Create a new communication template (New > Communication).
- Enter a From email address for the email.
- Click Choose Recipients, and then select the query that you just created to provide the necessary data fields ($/Common/Communications/Queries/Event registrations). Click Return to Compose.
- Compose the email and add a Subject. Add the desired fields related to the event registration to your email by selecting from the Insert field drop-down.
- Click Preview to review your email. Correct any fields that display an error in preview mode.
- Click Save and enter a name for the communication template (such as Event confirmation).
Creating the automated task PLUS
Note: The following information is considered a PLUS feature and additional licensing is required. For more information, contact your AiSP or ASI Technical Support.
Create an automated task that will send your confirmation email to registrants as soon as they register for an event. To do this:
- Navigate to RiSE > Process Automation.
- Select Add new task:
- Enter a Name for the task, such as Send event confirmation email. For the Type, select Scheduled task.
- Select the Enabled checkbox.
- Select Add trigger.
- For the trigger Type select On database change.
- From Table, select Order_Meet. The TriggerID property will display as ORDER_NUMBER. This indicates that the ORDER_NUMBER property can be used as a filter in IQA queries with the @TriggerID dynamic filter, in order to return only results for the row that triggered the task.
- Enable Row inserted to trigger the task only when a new event registration is added to the Order_Meet table.
- Select the Enabled checkbox, then click Save.
- Click Save, then Close the task.
Updating the query for use in the automated task
In order to use the Event registrations query in the automated task, you need a filter using the @TriggerID dynamic filter. You can copy the existing Event registrations query in order to preserve the original version, which can still be used in the Event confirmation template:
- Go to RiSE > Intelligent Query Architect, and navigate to $/Common/Communications/Queries. Select the Event registrations query and click Organize > Copy.
- Navigate to $/Common/Tasks/Queries and click Organize > Paste. Select the Event registrations query and click Edit.
- Update the Name to Event registrations for automated task.
- (Filters tab) Add a filter for Order Number using the @TriggerID keyword. This will filter the query to only return results where the Order Number matches the Order Number of the row that triggered the task to run. The query will not return any results when run directly in IQA.
- In the Property column, select CsRegistration.Order Number from the drop-down.
- In the Comparison column select Equal.
- For the Value, enter "@TriggerID".
- Click the + button to add the filter.
- Click Save.
Completing the automated task setup PLUS
Note: The following information is considered a PLUS feature and additional licensing is required. For more information, contact your AiSP or ASI Technical Support.
Now that the query is defined to filter only to the registration that triggers the task, you can use the query as a data source in the Conditions and Actions of the automated task.
- Go to RiSE > Process Automation and select the Event confirmation email automated task.
- (Conditions tab) Add the query to the Conditions in order to prevent the actions from running if there are no results.
- Click Add data source.
- Enter a Name for the data source without using spaces, such as “EventRegistration”
- In the Query field, click select and choose the Event registrations for automated task query .
- Click Save.
- (Actions tab) Add an action to send the event confirmation communication.
- Click Add action.
- Select Send a communication from the Type drop-down.
- Choose EventRegistration as the Recipient data source. For your Communication, select the Event confirmation template you previously created.
- Save your choices.
You can test the task by creating a test user with an email address that you have access to, and registering for an event.