Email Templates using Razor Engine

Razor Engine allows you to use Razor syntax to build robust email templates. We need to know your opinion about that! Make any sense modify the email templates to Razor Syntax? Leave us a message how important is this feature in you ZB software.

More about Razor Engine:

https://www.nuget.org/packages/RazorEngine/

Example:

 Razor.SetTemplateBase(typeof(HtmlTemplateBase<>));
  
  string template = 
  @"<html>
      <head>
        <title>Hello @Model.Name</title>
      </head>
      <body>
        Email: @Html.TextBoxFor(m => m.Email)
      </body>
    </html>";
    
  var model = new PageModel { Name = "World", Email = "someone@somewhere.com" };
  string result = Razor.Parse(template, model);
0 replies

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply

Your email address will not be published. Required fields are marked *