public SendGridEmailProvider(IEmailProviderOptions options) { this.apiKey = options.Parameters["Key"]; if (string.IsNullOrWhiteSpace(this.apiKey)) { throw new ArgumentNullException("apiKey"); } }
public SmtpEmailProvider(IEmailProviderOptions options) { this.host = options.Parameters["Host"]; if (string.IsNullOrWhiteSpace(this.host)) { throw new ArgumentNullException("Host"); } var portString = options.Parameters["Port"]; if (string.IsNullOrWhiteSpace(portString) || !int.TryParse(portString, out this.port)) { throw new ArgumentException("Port"); } this.username = options.Parameters["UserName"]; this.password = options.Parameters["Password"]; }
public InMemoryEmailProvider(IEmailProviderOptions options, IInMemoryEmailRepository inMemoryEmailRepository) { this.inMemoryEmailRepository = inMemoryEmailRepository; }
public IEmailProvider BuildProvider(IEmailProviderOptions options) { return(new SmtpEmailProvider(options)); }
public IEmailProvider BuildProvider(IEmailProviderOptions providerOptions) { return(EmailProvider); }
public IEmailProvider BuildProvider(IEmailProviderOptions options) { return(new InMemoryEmailProvider(options, this.inMemoryEmailRepository)); }