Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public string SendTriggerMail(string emailAddress,
- string subscriberKey,
- string triggerMailId)
- {
- IExactTargetService exactTargetServiceClient = new ExactTargetServiceClient
- {
- ClientCredentials = { UserName = { UserName = "", Password = "" } }
- };
- var id = new ClientID { ID = 1234567, IDSpecified = true };
- var definition = new TriggeredSendDefinition
- {
- CustomerKey = triggerMailId,
- Client = id,
- FromAddress = "test@test.com",
- FromName = "Test",
- SendClassification = new SendClassification
- {
- SenderProfile = new SenderProfile
- {
- ReplyManagementRuleSet = new ReplyMailManagementConfiguration
- {
- EmailReplyAddress = "test@test.com",
- EmailDisplayName = "Test",
- }
- }
- }
- };
- var send = new TriggeredSend { TriggeredSendDefinition = definition, Client = id };
- var subscriber = new Subscriber
- {
- EmailAddress = emailAddress,
- SubscriberKey = subscriberKey
- };
- var allAttributes = new List<Attribute>
- {
- new Attribute { Name = "SomeAttribute", Value = "AttributeValue" }
- };
- subscriber.Attributes = allAttributes.ToArray();
- send.Subscribers = new[] { subscriber };
- APIObject[] sends = { send };
- var response = exactTargetServiceClient.Create(
- new CreateRequest(new CreateOptions(), sends));
- return response.OverallStatus;
- }
Add Comment
Please, Sign In to add comment