剃刀意见电子邮件模板 [英] Razor views as email templates
本文介绍了剃刀意见电子邮件模板的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我创建的MVC3电子邮件引擎,我试图用剃刀意见电子邮件模板。
我听说这是可能的,但我还没有找到任何关于它的信息。
I am creating an email engine in mvc3 and I am trying to use razor views as email templates. I heard this is possible but I have not yet found any information about it.
推荐答案
您可以使用 HTTP://razorengine.$c$cplex .COM / 来实现这一目标。它可以让你用剃刀MVC之外。
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" });
这是实现简单,它可以在 HTTP://nuget.$c$cplex.com/ 方便集成到您的项目。
这篇关于剃刀意见电子邮件模板的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文