Identityserver4.admin: Email templates

Created on 21 Feb 2019  路  4Comments  路  Source: skoruba/IdentityServer4.Admin

Hello community, question for you.

Right now we're using template saved in AccountController.resx:

| Name | Value |
| ------------- |:-------------:|
| ConfirmEmailBody | Please confirm your account by <a href='{0}'>clicking here</a>.|
| ResetPasswordBody| Please reset your password by <a href='{0}'>clicking here</a>.|

And we fill it with generated links just before passing it to IEmailSender:

Task SendEmailAsync(string email, string subject, string htmlMessage)

But probably will need to find solution that will allow admins to use email templates. Is there a good solution for templating emails that you know?

Currently I'm considering adding to AccountController.resx project file as a resource which will be a plain html file with {0} for putting links and customizable info in. Let us know if you have any suggestions in this matter.

enhancement help wanted question

Most helpful comment

We use RazorEngine for templating emails.

All 4 comments

Can use configuration file to save the template?

Right now you can just copy paste your HTML into resources file and leave {0} for the url - it's something, but probably not ideal. What would you propose @Seaear ?

We use RazorEngine for templating emails.

We used RazorLight recently in a .NET Core project to generate email content.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ekjuanrejon picture ekjuanrejon  路  4Comments

xmichaelx picture xmichaelx  路  3Comments

saeedrahimi picture saeedrahimi  路  3Comments

maythamfahmi picture maythamfahmi  路  4Comments

Mehrdad-Davoudi picture Mehrdad-Davoudi  路  4Comments