Storing\Reading 带有 aspnetcore 的外部电子邮件模板

Storing\Reading an external email template with aspnetcore

我在我的 aspnet 核心站点中连接了 mailgun 来发送电子邮件,但我真的希望 "Template" 存储在外部文件系统(最好是 wwwroot)上,这样我就可以快速 change\tweak 无需重新发布任何内容。

我该如何完成这样的事情?

此致, 史蒂夫

我使用带有强类型模型的 Razor 来呈现电子邮件,因此模板只是 .cshtml 文件。

你可以看到我的code here which sends emails, it invokes this ViewRenderer, and you can see my Razor templates here

链接示例使用简单的基本类型作为模型,但我在我的其他项目中使用相同技术的更精细的视图模型