问题
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