Send a Marketing Cloud Transactional Email w/ .NET

6/14/2017 9:40:19 PM

To send a transaction email using Marketing Cloud and .NET, you must do the following.

- Create the Email (in Email Studio)

- Use AMPScript for the replacement tags 

- Create a Triggered Send and Associate with Email Above  (

- If you change the email template, pause the Triggered Send, Republish it, and start it again.


Thanks to Markus -

//uses the Nuget Package: ExactTarget.TriggerEmailSender

//.NET code

//create configuration
var config = new ExactTarget.TriggeredEmail.Core.Configuration.ExactTargetConfiguration
	ApiUserName = "",
	ApiPassword = "myUbreakablePassWord!",
	//use your endpoint given to you by ET, login to MC and look at your url
	EndPoint = "",
	//ClientId = 1111111,//optional business unit id

//name of the triggered send
var emailTemplateName = "trig--tran--test--password-reset";
//send email   
var recipientEmailAddress = "";

var triggeredEmail = new ExactTarget.TriggeredEmail.Trigger.ExactTargetTriggeredEmail(

triggeredEmail.SubscriberKey = recipientEmailAddress; //not needed

//set replacement/merge tags
triggeredEmail.AddReplacementValue("first_name", "John");                        
triggeredEmail.AddReplacementValue("login_link", "");

var emailTrigger = new ExactTarget.TriggeredEmail.Trigger.EmailTrigger(config);

//final call to actually send the email

//MC Email and AMPScript
    Var @link
    Set @link = AttributeValue("login_link")

    Var @firstName
    Set @firstName = AttributeValue("first_name")

<p>Dear %%=v(@firstName)=%%</p>
<a href="%%=RedirectTo(@link)=%%">%%=v(@link)=%%</a>