我们正在寻找一种快速,灵活的方式来从.NET控制台应用程序生成模板内容(在本例中为文本和HTML格式的个性化电子邮件)。
我们没有VirtualPathProvider,也没有有效的HttpContext.Current,根据我们的初步实验,这意味着使用WebForms视图引擎将非常非常困难,而其他任何.NET Web视图引擎(Spark,Razor)都是需要大量的管道来使他们认为他们正在Web应用程序中运行。
我想做类似的事情:
var customerTemplateData = GetTemplateDate(customer); var htmlBody = templateEngine.Render("template.html", customerTemplateData); var textBody = templateEngine.Render("template.txt", customerTemplateDate); SendMail("me@mydomain.com", customer.Email, "Hey there!", htmlBody, textBody);
而且我想使用复杂的嵌套数据,列表中的许多列表进行处理,每分钟最多进行1000次。
对于专用模板引擎或在独立上下文中运行Web视图引擎的方式的任何建议,将不胜感激:)
谢谢,