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:

  1. Create the confirmation email.
  2. Created the data extension used to store the confirmation information.
  3. Create the triggered send used to send the confirmation email.
  4. Create the API call.

The internal system submits the triggered send 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 example uses the BuildRowSetFromXML() AMPscript 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:

  1. Create the data extention from the TriggeredSendDataExtension template.

  2. Check the Used for Sending checkbox.

  3. Choose EmailAddress in the first drop-down menu under the Type heading.

  4. Choose Email Address in the second drop-down menu under the Type heading.

  5. Under the Fields heading, enter the following information in the third field under SubscriberKey and EmailAddress:

    • Name: confirmation_xml
    • Data Type: Text
    • Length: 2000
  6. Click the Use Data Retention checkbox.

You can create the triggered send used to send the confirmation information in the web interface or by using the SOAP API. Include the following information in your triggered send and start the triggered send once you have completed it:

  1. Select Default Commercial in the Send Classification drop-down menu.
  2. Select the email you created for this triggered send in the Email window.
  3. Select the data extension you created for this triggered send in the "Triggered Send" Data Extensions field.