Developer Community Triggered Send Scenario
Jen develops software for Northern Trail Outfitters, and her latest project involves working with her team to develop a new ecommerce site. Her tasks include integrating the ecommerce site with the Northern Trail Outfitters account to send several types of messages. These include welcome emails that are sent when the customer first creates an account, and purchase confirmations and receipts after a sale. These types of messages are transactional emails.
Northern Trail Outfitters marketers continue to handle all marketing emails, and they also develop all of the necessary content for transactional emails. Jen handles the API code that calls the correct email message and creates and executes the sending of these transactional emails. She works with C# code and receives credentials from her supervisor.
Before doing anything else, Jen must successfully connect her development environment to SOAP API. Because she’s writing .NET/C# code, Jen connects using Visual Studio and successfully executes a call to retrieve the availability status of the API.
Now that Jen has successfully connected her development environment, she must understand how Marketing Cloud Engagement stores the data necessary to execute the email sends. Because the ecommerce site is new, Jen has the opportunity to work with others involved in implementing Marketing Cloud Engagement and decide how they identify individual users and store the applicable information.
At this point, Jen relies on documentation to understand more about the application. She also learns about triggered sends and realizes that these email messages perform the function she’s responsible for implementing. The ecommerce site sends these messages when certain actions occur. She also learns about both subscriber lists and data extensions. Jen isn't the only person that uses this information, but she does have a stake in making the final decision.
Jen also takes the time to familiarize herself with the API documentation to understand how to best write her code. Because the new ecommerce site relies on email to communicate with customers, Jen decides to make the email address the primary identifier for all customers. She also decides to store this information in data extensions, per the best practice recommendations. Finally, she decides to write her code to take advantage of both synchronous and asynchronous API calls.
The marketers for Northern Trail Outfitters handle the actual creation of the email content and messages. However, they must provide Jen with the external keys for these email messages so she can retrieve these items into the email send definitions.
Jen discovers that triggered send definitions must be created and then started in order to make them functional. Initially, Jen has to create triggered send definitions for two different interactions:
- A welcome email thanking customers for creating an account with Northern Trail Outfitters
- A confirmation email thanking customers for a purchase
After she creates those triggered send definitions, she starts them to ensure they can accept incoming calls.
Jen must also learn how to handle error codes associated with triggered send definitions and the triggered send itself.
For synchronous processing, Jen casts the CreateResult to a TriggeredSendCreateResult to gain access to the SubscriberFailures array.
For asynchronous processing, the ResultMessage object represents the focal point for exception handling. Jen retrieves the ResultMessage for each request using the retrieve method, read from an email attachment or available as HTTP post variables. The ResultDetailXML property contains a serialized TriggeredSendCreateResult that provides more information about the error.
Both Jen and NTO's Marketing team want to know how customers are interacting with these transactional emails. Jen retrieves a tracking send summary to get the information needed and act accordingly.
After initial testing and implementation, Jen and the team want to expand their efforts to handle increased load and more features.
Jen also recommends creating more email messages and personalizing them to the specific customer. Until this point, the email messages used fixed content to welcome the customer and let them know that the transaction had cleared. Jen recommends that NTO's Marketing team includes dynamic content in their email messages to include the attributes such as first name, last name, and a list of recent purchases.
Jen also creates more triggered send definitions to accommodate customers who want to change their usernames and passwords. These definitions include HTML email messages created by the Marketing team and sent to Jen for inclusion in the triggered send definition. These HTML emails contain references to information in the data extension for use in the email message.
To ensure that all API calls are properly handled, Jen uses the asynchronous API for further development on the ecommerce site. This step involves rewriting existing functionality, but Jen feels that the solution scales better and allows for better management of her API calls.
Jen also considers building a landing page for the marketers to view the triggered send tracking information she retrieves via the API. She stores this information in a data extension and builds a landing page using AMPscript that returns the tracking information for easy viewing.
- Marketing Cloud Engagement Help: Data Extensions
- Marketing Cloud Engagement Help: Subscriber Lists
- Marketing Cloud Engagement Help: Dynamic Content
- Retrieve the Availability Status of an Account
- Retrieve an Email
- Create Triggered Send Definition
- Start Triggered Send Definition
- Error Codes
- CreateResult Object
- TriggeredSendCreateResult Object
- ResultMessage Object
- Retrieve a Triggered Send Summary
- Asynchronous Processing