We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
So as not to have all the handling of the email templates in the core. You can create an interface .
public interface IEmailTemplateParser<T> { string PrepareEmail(T data , string stringTemplate); }
Classes that handle email templates would implement that interface and by convention the class name should end in "TemplateParser"
Modify the appsettings.json section as follows.
"EmailTemplateSettings": [ { "Name": "ActivateNewUser", "TemplateName": "activate-new-user-template.html", "Subject": "XXXXXXX" }, { "Name": "ResetPassword", "TemplateName": "reset-password-template.html", "Subject": "YYYYYYYYY" } ]
Modify the way to load the Options as follows. services.Configure<List>
When you need to obtain the values a specific template, you look for it like this.
var templateInfo = emailTemplateSettings.Find(x => x.Name.Contains("ActivateNewUser"));
var core = System.Reflection.Assembly.GetExecutingAssembly(); builder.RegisterAssemblyTypes(core) .Where(t => t.Name.EndsWith("TemplateParser")) .AsImplementedInterfaces();
To record the types, include this in the module.
I hope my idea seems good to you and I apologize for the terrible English.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
So as not to have all the handling of the email templates in the core.
You can create an interface .
Classes that handle email templates would implement that interface and by convention the class name should end in "TemplateParser"
Modify the appsettings.json section as follows.
"EmailTemplateSettings":
[
{
"Name": "ActivateNewUser",
"TemplateName": "activate-new-user-template.html",
"Subject": "XXXXXXX"
},
{
"Name": "ResetPassword",
"TemplateName": "reset-password-template.html",
"Subject": "YYYYYYYYY"
}
]
Modify the way to load the Options as follows.
services.Configure<List>
When you need to obtain the values a specific template, you look for it like this.
var templateInfo = emailTemplateSettings.Find(x => x.Name.Contains("ActivateNewUser"));
To record the types, include this in the module.
I hope my idea seems good to you and I apologize for the terrible English.
The text was updated successfully, but these errors were encountered: