Create a Sender Profile

You can use a sender profile to specify the From information of an email message and a fallback address. This From information can then be reused over several email sends without having to specify the individual elements again. The fallback address must be a verified email address. To verify email addresses, use the REST API domain verification resources.

Use the sample code below as a model to construct your own API calls.

Sample .NET Code 

1public static void createSenderProfile() {
2            SoapClient partnerApi = new SoapClient();
3            partnerApi.ClientCredentials.UserName.UserName = "username";
4            partnerApi.ClientCredentials.UserName.Password = "password";
5            //Instantiate SenderProfile and set general properties
6            SenderProfile sp = new SenderProfile();
7            sp.FromAddress = "reply@example.com";
8            sp.FromName = "Example Reply Name";
9            sp.CustomerKey = "12345";
10            sp.Name = "123456";
11            sp.Description = "Used for overriding the RMM settings";
12            //optional - override the default RMM
13            sp.UseDefaultRMMRules = false;
14            sp.UseDefaultRMMRulesSpecified = true;
15            //optional - forward the email on with a triggered send (must specify override default RMM)
16            TriggeredSendDefinition tsdForward = new TriggeredSendDefinition();
17            tsdForward.CustomerKey = "12345";
18            sp.AutoForwardTriggeredSend = tsdForward;
19            sp.AutoForwardToEmailAddress = "acruz@example";
20            sp.AutoForwardToName = "Angel Cruz";
21            //optional - send Auto Reply (must specify override default RMM)
22            sp.AutoReply = true;
23            sp.AutoReplySpecified = true;
24            TriggeredSendDefinition tsdAutoReply = new TriggeredSendDefinition();
25            tsdAutoReply.CustomerKey = "My_TSD";
26            sp.AutoReplyTriggeredSend = tsdAutoReply;
27            //create the Sender Profile
28            string requestID = string.Empty;
29            string status = string.Empty;
30            CreateResult[] results = partnerApi.Create(null, new APIObject[] { sp }, out requestID, out status);
31            //parse the results for objectID or error
32            if (status.ToUpper() == "OK") {
33                Console.WriteLine("SenderProfile Created");
34                Console.WriteLine("SenderProfile ID: " + results[0].NewObjectID.ToString());
35            } else {
36                Console.WriteLine("SenderProfile Created");
37                Console.WriteLine(results[0].StatusMessage);
38            }
39        }

Example SOAP Envelope 

1<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
2 <soap:Header>
3 <wsse:Security soap:mustUnderstand="1">
4 <wsse:UsernameToken wsu:Id="SecurityToken-d19fb7b0-ec6d-49a8-8fd3-796819ec7306">
5 <wsse:Username>XXXXX</wsse:Username>
6 <wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">XXXXX</wsse:Password>
7 </wsse:UsernameToken>
8 </wsse:Security>
9 </soap:Header>
10 <soap:Body>
11 <CreateRequest xmlns="http://exacttarget.com/wsdl/partnerAPI">
12 <Objects xsi:type="SenderProfile">
13 <PartnerKey xsi:nil="true"/>
14 <ObjectID xsi:nil="true"/>
15 <Name>API Created Sender Profile</Name>
16 <CustomerKey>12345</CustomerKey>
17 <Description>API Created Sender Profile</Description>
18 <FromName>Angel Cruz</FromName>
19 <FromAddress>acruz@example.com</FromAddress>
20 </Objects>
21 </CreateRequest>
22 </soap:Body>
23</soap:Envelope>

Related Items