This is a base library to provide utilities for working with email in .NET 6. This project is used by more concrete implementations such as NetCore.Utilities.Email.Smtp.
Starting with version 7.0, all IEmailService
methods have been converted to asynchronous operations.
Standard installation via NuGet Package Manager
Install-Package ICG.NetCore.Utilities.Email
However, it should be noted this is typically added by association from other packages
To setup the needed dependency injection items for this library, add the following line in your DI setup.
services.UseIcgNetCoreUtilitiesEmail();
You can then configure email templates inside of your applications configuration file.
{
"EmailTemplateSettings": {
"DefaultTemplatePath": "Template.html",
"AdditionalTemplates": { "SpecialTemplate": "File.html" }
}
}
You may configure as many additional templates as desired. All paths are relative to the ContentRoot as identified in the IHostingEnvironment value for the currently running application.
Inline code documentation is included for usage within the application.
The following tokens are utilized in the templating process
- [SUBJECT]
- [PREVIEW]
- [CONTENT]
ICG has a number of other related projects as well