Razor email templates in .net standard 2.1 / Core 3.1

萝らか妹 提交于 2020-12-13 03:44:06

问题


I want to create a separate service for sending emails, this will be based on a .net core 3.1 application with its default layers (application, domain, contracts, infrastructure)

Within this project, I want to create a create a class library which holds my Razor templates and parses them so the application layer can send this as an email (both HTML and non-html) after the model has been applied, however this is where i run into a problem.

Every example i can find targets older .net core applications, which means nuget packages like RazorEngine.NetCore won't work.

Also examples as found in https://emilol.com/razor-mailer/ won't work as they target older frameworks.

A deep dive into the Razor Client Library also didn't work as i tried to adjust this sample for 3.1 https://derekarends.com/how-to-create-email-templates-with-asp-net-core-2-2/

Is there any way to make this work or do i really need to target an older framework just to create a email template library?

来源:https://stackoverflow.com/questions/61352635/razor-email-templates-in-net-standard-2-1-core-3-1

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!