Esempio n. 1
0
 public MailgunMailer(IHttpClientFactory httpClientFactory, MailgunMailerOptions options, ISendValidator validator, ILogger <MailgunMailer> logger)
 {
     _httpClientFactory = httpClientFactory;
     _options           = options;
     _validator         = validator;
     _logger            = logger;
 }
        public MailgunMailerOptions Create()
        {
            var server               = new Uri(_configuration["Mailgun:Server"]);
            var userName             = _configuration["mailgunuser"];
            var password             = _configuration["mailgunkey"];
            var domain               = _configuration["Mailgun:Domain"];
            var credentials          = new MailgunMailerCredentials(userName, password);
            var mailgunMailerOptions = new MailgunMailerOptions(server, credentials, domain);

            return(mailgunMailerOptions);
        }