Class ServiceCollectionExtensions
- Namespace
- CMS.EmailEngine
- Assembly
- CMS.EmailEngine.dll
Class contains extension methods for the Microsoft.Extensions.DependencyInjection.IServiceCollection interface.
public static class ServiceCollectionExtensions
- Inheritance
-
objectServiceCollectionExtensions
Methods
AddXperienceChannelSmtp(IServiceCollection, string, Action<SmtpOptions>)
Adds services required for sending emails via SMTP provider for emails sent from specific channel.
public static IServiceCollection AddXperienceChannelSmtp(this IServiceCollection serviceCollection, string channelName, Action<SmtpOptions> configure = null)
Parameters
serviceCollection
IServiceCollectionchannelName
stringconfigure
Action<SmtpOptions>
Returns
- IServiceCollection
Remarks
When used in combination with AddXperienceSmtp(IServiceCollection, Action<SmtpOptions>) and in case of missing configuration for some channel, the email client registered via AddXperienceSmtp(IServiceCollection, Action<SmtpOptions>) will be used as a fallback email client for sending emails from channels without configuration.
AddXperienceSmtp(IServiceCollection, Action<SmtpOptions>)
Adds services required for sending emails via SMTP provider.
public static IServiceCollection AddXperienceSmtp(this IServiceCollection serviceCollection, Action<SmtpOptions> configure = null)
Parameters
serviceCollection
IServiceCollectionconfigure
Action<SmtpOptions>
Returns
- IServiceCollection
Remarks
If not used with AddXperienceSystemSmtp(IServiceCollection, Action<SmtpOptions>) and AddXperienceChannelSmtp(IServiceCollection, string, Action<SmtpOptions>), this email client will be used for sending all emails.
When used in combination with AddXperienceChannelSmtp(IServiceCollection, string, Action<SmtpOptions>) and in case of missing configuration for some channel, this email client will be used as a fallback email client for sending emails from channels without configuration and also for all system emails.
AddXperienceSystemSmtp(IServiceCollection, Action<SmtpOptions>)
Adds services required for sending emails via SMTP provider for system emails (all non-channel related emails).
public static IServiceCollection AddXperienceSystemSmtp(this IServiceCollection serviceCollection, Action<SmtpOptions> configure = null)
Parameters
serviceCollection
IServiceCollectionconfigure
Action<SmtpOptions>
Returns
- IServiceCollection
ConfigureSystemSmtpOptions(IServiceCollection, IConfiguration)
Registers SMTP email client configuration for system emails.
public static IServiceCollection ConfigureSystemSmtpOptions(this IServiceCollection services, IConfiguration config)
Parameters
services
IServiceCollectionconfig
IConfiguration
Returns
- IServiceCollection
Remarks
This is required if the AddXperienceSystemSmtp(IServiceCollection, Action<SmtpOptions>) method is called without the Action<SmtpOptions>
parameter.