Create a Triggered Send Using the Async API

By using the async API, you can ensure that your call is queued and ready to execute after the call is completed, even if your network connection is interrupted. You can also prioritize triggered sends and use the CorrellationID and ConversationID objects to track an exchange of emails related to the triggered send.

This feature isn’t enabled by default in most accounts. For more information about enabling this feature, contact your Account Executive.

Sample .NET Code 

1private void TriggeredAsync()
2{
3    SoapClient framework = new SoapClient();
4    framework.ClientCredentials.UserName.UserName = "XXX";
5    framework.ClientCredentials.UserName.Password = "XXX";
6    String requestID;
7    String status;
8    TriggeredSend ts = new TriggeredSend();
9    Subscriber sub = new Subscriber();
10    TriggeredSendDefinition tsd = new TriggeredSendDefinition();
11    sub.EmailAddress = "help@example.com";
12    sub.SubscriberKey = "help@example.com";
13    sub.CorrelationID = "help@example.com_SUB_11111"
14    tsd.CustomerKey = "TEXTEXT";
15    ts.TriggeredSendDefinition = tsd;
16    ts.Subscribers = new Subscriber[] { sub };
17    CreateOptions co = new CreateOptions();
18    co.RequestType = RequestType.Asynchronous;
19    co.RequestTypeSpecified = true;
20    co.SendResponseTo = new AsyncResponse[1];
21    co.SendResponseTo[0] = new AsyncResponse();
22    co.SendResponseTo[0].RespondWhen = RespondWhen.OnCallComplete;
23    co.SendResponseTo[0].RespondWhenSpecified = true;
24    co.SendResponseTo[0].ResponseType = AsyncResponseType.email;
25    co.SendResponseTo[0].ResponseAddress = "help@example.com";
26    co.SendResponseTo[0].IncludeResults = true;
27    co.SendResponseTo[0].IncludeResultsSpecified = true;
28    co.SendResponseTo[0].IncludeObjects = true;
29    co.SendResponseTo[0].IncludeObjectsSpecified = true;
30    co.ConversationID = "HELP_CONVERSATION_11111";
31    CreateResult[] cresults = framework.Create(co, new APIObject[] { ts }, out requestID, out status);
32    foreach (CreateResult result in cresults)
33    {
34        Console.WriteLine(result.StatusMessage);
35    }
36    Console.WriteLine(requestID + ": " + status);
37    //Readline pauses the output so you can see the results
38    Console.ReadLine();
39}

Related Items 

Asynchronous Processing