One of our teams is looking to automate their send process - at the moment they do a guided send in the SFMC UI to send a email to a DE. What I've been trying to work out is which API objects I should be using to send an email to a Data Extension. I think I need to create a SendDefninition and then do a triggered send, but I don't seem to be able to add suppression lists like this and I can in a guided send. Am I missing something here?
-
1If this is a scheduled repetitive event, you can create a User Initiated send (allows Suppression lists) and put it in a scheduled automation. This automation could also be used as a trigger via an API call to run the automation. (salesforce.stackexchange.com/questions/140001/…)– GortoningtonCommented Aug 16, 2017 at 13:01
1 Answer
The Guided Send is created and sent through the SOAP API using the EmailSendDefinition with Create or Perform SoapActions/Methods. A good place to see examples of both creating and performing EmailSendDefintions is available in the developer documentation. The document shows sending to data extensions and using exclusion lists.
Sample SOAP Envelopes from Documentation:
Perform SOAP Envelope
<s:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Header xmlns:wsa="http://www.w3.org/2005/08/addressing">
<wsse:Security soapenv:mustUnderstand="1" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
<wsse:UsernameToken wsu:Id="UsernameToken-30851894" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"> <wsse:Username>Username</wsse:Username>
<wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">Password</wsse:Password>
</wsse:UsernameToken>
</wsse:Security>
<wsa:To>https://webservice.exacttarget.com/Service.asmx</wsa:To>
<wsa:MessageID>urn:uuid:FAB69169EC56A8F9D51228490514867</wsa:MessageID>
<wsa:Action>Retrieve</wsa:Action>
</soapenv:Header>
<s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<PerformRequestMsg xmlns="http://exacttarget.com/wsdl/partnerAPI">
<Options></Options>
<Action>start</Action>
<Definitions>
<Definition xmlns:q1="http://exacttarget.com/wsdl/partnerAPI" xsi:type="q1:EmailSendDefinition">
<q1:ObjectID xsi:nil="true"></q1:ObjectID>
<q1:CustomerKey>7dc973cc-e0ab-4aec-9ba8-cf0b739e02dc</q1:CustomerKey>
<q1:Name>ESD_Name_7dc973cc-e0ab-4aec-9ba8-cf0b739e02dc</q1:Name>
<q1:Description>ESD_Desc_7dc973cc-e0ab-4aec-9ba8-cf0b739e02dc</q1:Description>
<q1:SendClassification>
<q1:ObjectID>51422ad6-6f65-de11-bf42-001e0bbb7678</q1:ObjectID>
</q1:SendClassification>
<q1:SendDefinitionList>
<q1:ObjectID xsi:nil="true"></q1:ObjectID>
<q1:CustomerKey>SDL CustomerKey</q1:CustomerKey>
<q1:SendDefinitionListType>SourceList</q1:SendDefinitionListType>
<q1:CustomObjectID>729860f8-7d66-de11-bf42-001e0bbb7678</q1:CustomObjectID>
<q1:DataSourceTypeID>CustomObject</q1:DataSourceTypeID>
<q1:Name>SDL Name</q1:Name>
</q1:SendDefinitionList>
<q1:Email>
<q1:ID>123</q1:ID>
<q1:ObjectID xsi:nil="true"></q1:ObjectID>
</q1:Email>
<q1:EmailSubject>ESD Email Subject</q1:EmailSubject>
<q1:Additional>cb99f3b1-67a4-452a-94c0-886e9a930961</q1:Additional>
</Definition>
</Definitions>
</PerformRequestMsg>
</s:Body>
</s:Envelope>
SOAP Request for Starting Email Send Definition
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Header>
<wsse:Security soapenv:mustUnderstand="1" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
<wsse:UsernameToken wsu:Id="UsernameToken-28677619" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
<wsse:Username>username</wsse:Username>
<wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">password</wsse:Password>
</wsse:UsernameToken>
</wsse:Security>
</soapenv:Header>
<soapenv:Body>
<PerformRequestMsg xmlns="http://exacttarget.com/wsdl/partnerAPI">
<Options/>
<Action>start</Action>
<Definitions>
<Definition xsi:type="ns1:EmailSendDefinition" xmlns:ns1="http://exacttarget.com/wsdl/partnerAPI">
<CustomerKey>Market2Lead_Email_Definition_Key</CustomerKey>
</Definition>
</Definitions>
</PerformRequestMsg>
</soapenv:Body>
</soapenv:Envelope>