GithubHelp home page GithubHelp logo

Comments (2)

SeanKilleen avatar SeanKilleen commented on June 3, 2024

@grishmadoshi do you need to actually use template content areas? When I'm doing something as simple as replacing a username, in Mandrill I prefer just using merge tags.

The syntax for a merge tag is opened with *| and closed with |*, so your variable would be along the lines of *|USER_NAME|*.

Then, using Mandrill, you could do something along the lines of:

var mandrill = new MandrillApi("YourApiKeyHere");
var email = new EmailMessage
{ 
          //additional setup here for recipients, etc. 
} 

email.AddRecipientVariable(customerEmail, "USER_NAME", username); 
// where customerEmail is the recipient address, and username is your username variable.

mandrill.SendMessage(email, "mandrill-template-slug-name", null);

The setup worked for me recently when I had to send an outage notice, though I used .AddGlobalVariable() to keep it simple because I was sending the same variables for each recipient at that point.

[Ed. Note: edited to use "merge tags", which is the correct term, instead of "template variables", which was a term I made up.]

from mandrill-dotnet.

SeanKilleen avatar SeanKilleen commented on June 3, 2024

I added a Wiki article on using Merge Tags with the wrapper that can hopefully serve as a reference going forward.

Given that, it might be worth closing this as an issue as it's a few months old.

@grishmadoshi, if you still encounter a problem, you may want to comment here or form a new issue.

from mandrill-dotnet.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.