views:

439

answers:

2

I'm looking to create emails, mainly HTML, based on templates - I'd really like to do something like:

  1. Set up my template, as an HTML (or similar) file
  2. Include tags, that are then replaced with specific data (kind of like mail-merge....)

I've seen this: http://www.bitethebullet.co.uk/EmailTemplateFramework/tabid/58/Default.aspx

From searching on stack overflow, i understand nVelocity might be another option? But i can't find any examples to do what i want to do...

Any other suggestions?

+3  A: 

This kind of functionality is already built in. See MailDefinition class. For more complex scenarios you might want to consider something like NVelocity. I've had a lot of success with StringTemplate's C# port.

RichardOD
A: 

I've just released an open source project for precisely this purpose. You can read some more details and grab the source code from my blog.

http://thecodedecanter.wordpress.com/2010/07/19/town-crier-an-open-source-e-mail-templating-engine-for-net/

Oenotria