[SalesForce] Sending a triggered send to multiple To/CC/BCC recipients via the API

I'm working on a console application that uses the ExactTarget API to send out emails.

I'm trying to add a CC to the emails but for some reason I can't get it to work. I am basically creating the TriggeredSendDefinition in code, then adding it to a TriggeredSend object, and calling the Create method.

Here's what i'm trying:

TriggeredSendDefinition tsd = new TriggeredSendDefinition();
tsd.CustomerKey = externalKey;
tsd.CCEmail = "%%CCAddress%%";

TriggeredSend ts = new TriggeredSend();
ts.TriggeredSendDefinition = tsd;
ts.Subscribers = new Subscriber[1];

ts.Subscribers[0] = new Subscriber();
ts.Subscribers[0].EmailAddress = emailAddress;
ts.Subscribers[0].SubscriberKey = emailAddress;

ts.Subscribers[0].Attributes = new ExactTarget.Attribute[2];
ts.Subscribers[0].Attributes[0] = new ExactTarget.Attribute();
ts.Subscribers[0].Attributes[0].Name = "HTML__table";
ts.Subscribers[0].Attributes[0].Value = emailContent;

ts.Subscribers[0].Attributes[1] = new ExactTarget.Attribute();
ts.Subscribers[0].Attributes[1].Name = "CCAddress";
ts.Subscribers[0].Attributes[1].Value = "staticemail@email.com";
string tsRequestID = "";
string tsStatus = "";
CreateResult[] results = client.Create(new CreateOptions(), new APIObject[] { ts }, out tsRequestID, out tsStatus);
return results[0].StatusMessage;

Using this approach i receive the email for the original recipient, but don't see a CC on the email.

I've also tried just setting the CCEmail property of the TriggeredSendDefinition object to the CC email i want to send it to instead of using the attribute approach and it did not work. I read about the attribute approach from the exacttarget forums and tried it but to no avail.

My goal is to be able to pass in a list of email address for that CC field, to be able to CC the email to various clients.

An alternative would also be to send the same email to multiple recipients using the normal "TO" field.

Any thoughts?

Thanks,

TS.

Best Answer

The BCC functionality needs to be enabled on your account first. Talk to your account rep for details. You can see the note about it on the bottom of this page: http://help.exacttarget.com/en-US/technical_library/web_service_guide/objects/triggeredsenddefinition/

Related Topic