Razor views as email templates

You can use http://razorengine.codeplex.com/ to achieve this. It allows you to use razor outside of mvc.

string Email = "Hello @Model.Name! Welcome to Razor!";
string EmailBody = Razor.Parse(Email, new { Name = "World" });

It’s simple to implement and it’s available on http://nuget.codeplex.com/ for easy integration into your projects.

Leave a Comment