Confirm Purchases with Triggered Sends
This page contains conceptual and scenario information about using triggered sends to confirm online purchases. You can use the information in this document as a model to create your own triggered sends using the SOAP API.
Northern Trail Outfitters uses an internal system to process work-related airline tickets for their employees. When the employees book their travel via the internal site, they receive an email confirmation that includes a summary of the information regarding their travel plans. To make this system work, Northern Trail Outfitters performs the following tasks:
- Create the confirmation email
- Created the data extension used to store the confirmation information
- Create the triggered send used to send the confirmation email
- Create the API call from the internal system to Marketing Cloud
The internal system submits the triggered send to Marketing Cloud using a Java API call that includes the email address of the subscriber, the subscriber key, and confirmation information in XML format.
The email itself uses AMPscript to display information taken from the confirmation XML. This AMPscript uses the BuildRowSetFromXML function to create each record row for the email message, and it formats date and currency values automatically.
The next section provides the header for the email message.
The next section retrieves all passengers on the reservation using for/do loops to pull back all customer information.
The next section lists all ticket numbers and frequent flyer accounts for all reservations. The code alternates background colors for each line to aid readability of the information.
The next section displays all relevant flight information, including numbers, arrival and departure times, and number of stops.
The next section of code itemizes any costs associated with the reservation.
The next section of code places a disclaimer in the email.
The next section of code puts a footer in the email message.
The next section of code puts a menu at the bottom of the email message.
Create the data extension to hold the confirmation information using the information listed below:
Create the data extention from the TriggeredSendDataExtension template.
Check the Used for Sending checkbox.
Choose EmailAddress in the first drop-down menu under the Type heading.
Choose Email Address in the second drop-down menu under the Type heading.
Under the Fields heading, enter the following information in the third field under SubscriberKey and EmailAddress:
- Name: confirmation_xml
- Data Type: Text
- Length: 2000
Click the Use Data Retention checkbox.
You can create the triggered send used to send the confirmation information in Marketing Cloud or via the SOAP API. Include the following information in your triggered send and start the triggered send once you have completed it:
- Select Default Commercial in the Send Classification drop-down menu.
- Select the email you created for this triggered send in the Email window.
- Select the data extension you created for this triggered send in the "Triggered Send" Data Extensions field.