private async Task SendEmailAsync(TaxiReservation taxiReservation) { var sender = new MailgunSender(domainName, apiKey); Email.DefaultSender = sender; var user = await userService.FindUserByTaxiReservationIdAsync(taxiReservation.UserId); var taxi = await FindTaxiReservationByIdAsync(taxiReservation.TaxiReservationId); var template = " You received this message because your taxi has been booked in the Garnet Travel " + "reservation system." + "\r\n Your reservation time: " + taxi.TaxiReservationStart + "\r\n Pick-up location: " + taxi.StartLocal + "\r\n Drop-off location: " + taxi.EndLocal + "\r\n Number of travelers: " + taxi.NumberOfGuest + "\r\n Phone number: " + taxi.PhoneNumber + "\r\n\n Sincerely, Garnet Travel team" + "\r\n (This is an auto generated message, please do not reply!)"; var email = Email .From(domainName, "GarnetTravel.Info") .To(user.Email) .Subject($"Reservation notification #{taxiReservation.TaxiReservationId}") .UsingTemplate(template, false, false); await email.SendAsync(); }
public async Task <IActionResult> VerstuurMail(WekenViewModel wvm) { var mailgunKey = _configuration.GetSection("Mailgun").GetSection("key").Value; var domain = _configuration.GetSection("Mailgun").GetSection("domain").Value; if (ModelState.IsValid) { var sender = new MailgunSender( domain, mailgunKey ); Email.DefaultSender = sender; var email = Email .From("*****@*****.**", "Hans Fraiponts") .To(wvm.Ontvanger) .Subject("Werkuren Jobstudenten Lab9K") .Body(wvm.Inhoud); await email.SendAsync(); return(RedirectToAction(nameof(Index))); } else { TempData["error"] = "Er ging iets mis, contacteer Wim"; return(View(wvm)); } }
public EmailService() { _sender = new MailgunSender( "mail.aclarkesylvania.com", // Mailgun Domain "ec7f2e2b479823dca6bd5a8777f49954-ee13fadb-34652799" // Mailgun API Key ); }
/** * SwiftMailer does currently not work with IDN domains, this function therefore converts the domains * * FIXME: Remove this once SwiftMailer supports IDN * * @param string email * @return string Converted mail address if `idn_to_ascii` exists */ // protected string convertEmail(string email) { // if (!function_exists('idn_to_ascii') || !defined('INTL_IDNA_VARIANT_UTS46') || strpos(email, '@') === false) { // return email; // } // // list(name, domain) = explode('@', email, 2); // domain = idn_to_ascii(domain, 0,INTL_IDNA_VARIANT_UTS46); // return name.'@'.domain; // } protected ISender getInstance() { if (this.instance != null) { return(this.instance); } object sender = null; switch (this.config.getSystemValue("mail_smtpmode", "smtp")) { case "sendgrid": sender = new SendGridSender("", true); break; case "mailgun": sender = new MailgunSender("", ""); break; case "smtp": default: sender = this.getSmtpInstance(); break; } return((ISender)sender); }
public PluginEntry(ILogger <PluginEntry> logger) { _logger = logger; ConfigUtil.TryReadConfig(out var ec, "mailgun.json", new EMailConfig { Enabled = false, APIKey = string.Empty, APIDomain = string.Empty }); if (ec.Enabled) { _sender = new MailgunSender( ec.APIDomain, ec.APIKey, Enum.Parse <MailGunRegion>(ec.MailGunRegion) ); } ConfigUtil.TryReadConfig(out _recaptchaConfig, "recaptcha.json", new RecaptchaConfig { Enabled = false, PublicKey = string.Empty, PrivateKey = string.Empty }); Email.DefaultSender = _sender; }
private async Task SendEmailAsync(long hotelId, Reservation reservation) { var sender = new MailgunSender(domainName, apiKey); Email.DefaultSender = sender; var user = await userService.FindUserByHotelIdAsync(hotelId); var hotel = await hotelService.FindHotelByIdAsync(hotelId); var template = "You received this message because one of your hotel's room has been booked in the Garnet Travel " + "reservation system. \r\n\n Hotel name: " + hotel.HotelName + "\r\n Room number: " + reservation.RoomId + "\r\n Reservation start: " + reservation.ReservationStart + "\r\n Reservation end: " + reservation.ReservationEnd + "\r\n Number of guests: " + reservation.NumberOfGuest + "\r\n Total price: " + reservation.TotalPrice + "HUF" + "\r\n Reservations for this hotel: https://garnettravel.azurewebsites.net/hotelReservation/" + hotel.HotelId + "\r\n\n Sincerely, Garnet Travel team" + "\r\n (This is an auto generated message, please do not reply!)"; var email = Email .From("*****@*****.**", "GarnetTravel.Info") .To(user.Email) .Subject($"Reservation notification #{reservation.ReservationId}") .UsingTemplate(template, false, false); await email.SendAsync(); }
private static async Task Main() { var config = new ConfigBuilder(".").Build(); var parser = new ReadSharpParser(); var emailSender = new MailgunSender(config.MailGunSenderOptions.ApiKey, config.MailGunSenderOptions.HostEmail); var pocketClientMock = new Mock <IPocketClient>(); pocketClientMock.Setup(x => x.Get( It.IsAny <State>(), It.IsAny <bool>(), It.IsAny <string>(), It.IsAny <ContentType>(), It.IsAny <Sort>(), It.IsAny <string>(), It.IsAny <string>(), It.IsAny <DateTime>(), It.IsAny <int>(), It.IsAny <int>(), It.IsAny <CancellationToken>())).Returns( Task.FromResult( (IEnumerable <PocketItem>) new PocketItem[] { new PocketItem { Uri = new Uri("https://blog.wikimedia.org/2018/04/20/why-it-took-a-long-time-to-build-that-tiny-link-preview-on-wikipedia/") } } ) ); var sender = new ArticleSender(pocketClientMock.Object, parser, emailSender, config.ServiceDomain); await sender.SendArticlesAsync(new User { KindleEmail = "*****@*****.**", Token = "testtoken" }); }
public async Task <IActionResult> CheckOut(Order order) { if (cart.Lines.Count() == 0) { ModelState.AddModelError("", "Empty cart"); } if (ModelState.IsValid) { order.Lines = cart.Lines.ToArray(); repository.SaveOrder(order); decimal total = 0; foreach (var item in order.Lines) { total = total + item.Quantity * item.Product.Price; } Email.DefaultRenderer = new RazorRenderer(); var sender = new MailgunSender( "sandbox5794cb5050f84b339bbf1e38e4a73202.mailgun.org", // Mailgun Domain "key-21e40c5f3b6846415e516edbcbee371a" // Mailgun API Key ); Email.DefaultSender = sender; var template = "Dear @Model.Name, Your order total @Model.Total."; var email = Email .From("*****@*****.**") .To(order.Email) .Subject("Order") .UsingTemplate(template, new { order.Name, Total = total.ToString() }); var response = await email.SendAsync(); return(RedirectToAction(nameof(Completed))); } return(View(order)); }
public MailGunEmailSender(IOptionsSnapshot <EmailOptions> emailOptions) { _emailOptions = emailOptions.Value; var sender = new MailgunSender( _emailOptions.EmailDomain, _emailOptions.MailGunAPIKey ); Email.DefaultSender = sender; }
public Task SendEmailAsync(string account, string subject, string mess) { var domainName = _emailSettings.DomainName; var apiKey = _emailSettings.ApiKey; var sender = new MailgunSender(domainName, apiKey); Email.DefaultSender = sender; var email = Email.From(_emailSettings.From, "阳光数码运维平台") .To(account) .Subject(subject) .Body(mess); return(email.SendAsync()); }
public EmailSender(IOptions <EmailSettings> emailOptions) { _emailSettings = emailOptions.Value; var sender = new MailgunSender( _emailSettings.Domain, // Mailgun Domain _emailSettings.ApiKey // Mailgun API Key ); var razorRenderer = new RazorRenderer(); emailSender = new Email(razorRenderer, sender); }
static void SendFluentEmail() { var passPhrase = Environment.GetEnvironmentVariable("PASSPHRASE"); var domainName = DecryptAppSettings("DomainName", passPhrase); var apiKey = DecryptAppSettings("ApiKey", passPhrase); var toEmails = DecryptAppSettings("ToEmails", passPhrase); var fromEmail = DecryptAppSettings("FromEmail", passPhrase); var fromName = DecryptAppSettings("FromName", passPhrase); //var domainName = ConfigurationManager.AppSettings["DomainName"]; //var apiKey = ConfigurationManager.AppSettings["ApiKey"]; //var toEmails = ConfigurationManager.AppSettings["ToEmails"]; //var fromEmail = ConfigurationManager.AppSettings["FromEmail"]; //var fromName = ConfigurationManager.AppSettings["FromName"]; var sender = new MailgunSender( domainName, // Mailgun Domain apiKey // Mailgun API Key ); Email.DefaultSender = sender; // Parse a scriban template var template = Template.Parse("Dear {{name}}, You are totally {{compliment}}."); var bodyFromTemplate = template.Render(new { Name = "Luke", Compliment = "Awesome" }); //.UsingTemplate(template, new { Name = "Luke", Compliment = "Awesome" }) var objEmail = Email .From(fromEmail, fromName) .Subject(String.Format("FluentEmail.Mailgun Testing - {0}", DateTime.Now.ToString("yyyyMMddHHmmss"))) .Body(bodyFromTemplate); objEmail.AttachFromFilename("output.txt"); if (!String.IsNullOrEmpty(toEmails)) { String[] emails = toEmails.Split(';'); foreach (string email in emails) { objEmail.To(email); } } SendResponse response = objEmail.Send(); }
// This method gets called by the runtime. Use this method to add services to the container. public void ConfigureServices(IServiceCollection services) { services.AddDbContext <AppDbContext>(options => options.UseSqlServer(Configuration.GetConnectionString("DefaultConnection"))); services.AddIdentity <IdentityUser, IdentityRole>().AddEntityFrameworkStores <AppDbContext>(); //Data Access Layer Services services.AddTransient <IGroupDal, GroupDal>(); services.AddTransient <ICustomUserDal, CustomUserDal>(); services.AddTransient <IGroupMembershipDal, GroupMembershipDal>(); services.AddTransient <IGroupRulesDal, GroupRulesDal>(); services.AddTransient <IGroupMessagesDal, GroupMessagesDal>(); services.AddTransient <IMemberConditionsDal, MemberConditionsDal>(); services.AddTransient <ICustomUserDetailsDal, CustomUserDetailsDal>(); services.AddTransient <IGroupPairingsDal, GroupPairingsDal>(); // Add authentication services services.AddAuthentication( options => options.SignInScheme = CookieAuthenticationDefaults.AuthenticationScheme); //Test Dependency Injection services.AddTransient <ISecretSantaBl, SecretSantaBl>(); // Add framework services. services.AddMvc(); //session and cache services.AddDistributedMemoryCache(); // Adds a default in-memory implementation of IDistributedCache services.AddSession(); // Add functionality to inject IOptions<T> services.AddOptions(); //MailGun var sender = new MailgunSender( "elfbuddies.com", // Mailgun Domain //"sandbox3c051cffd5d14c0885493d6cfbe1fa8e.mailgun.org" "key-30e16c6964d4f339fab512a5aa3b988d" // Mailgun API Key ); Email.DefaultSender = sender; // Add the Auth0 Settings object so it can be injected services.Configure <Auth0Settings>(Configuration.GetSection("Auth0")); }
public static async Task <IActionResult> RunAsync( [HttpTrigger(AuthorizationLevel.Anonymous, "post", Route = null)] HttpRequest req, ILogger log, ExecutionContext context) { var _config = new ConfigBuilder(context.FunctionAppDirectory).Build(); var _emailSender = new MailgunSender(_config.MailGunSenderOptions.ApiKey, _config.MailGunSenderOptions.HostEmail); var _client = new PocketClient(_config.PocketConsumerKey, callbackUri: _config.PocketRedirectUri); string requestBody = new StreamReader(req.Body).ReadToEnd(); RegisterRequest request = JsonConvert.DeserializeObject <RegisterRequest>(requestBody); if (!IsValidEmail(request.KindleEmail)) { log.LogError($"Not valid email: {request.KindleEmail}."); return(new BadRequestObjectResult("email provided is not valid")); } PocketUser pocketUser = new PocketUser(); try { pocketUser = await _client.GetUser(request.RequestCode); } catch (PocketException pocketException) { log.LogError($"Something went wrong: {pocketException.Message}."); return(new BadRequestObjectResult(pocketException.Message)); } IUserService userService = UserService.BuildUserService(_config.StorageConnectionString); await userService.AddUserAsync(new User { AccessCode = pocketUser.Code, PocketUsername = pocketUser.Username, KindleEmail = request.KindleEmail, LastProcessingDate = DateTime.UtcNow, Token = Guid.NewGuid().ToString() }); await SendWelcomeEmail(_emailSender, request.KindleEmail); log.LogInformation($"Successfully registered user: {request.KindleEmail}."); return(new OkObjectResult("Registration successful")); }
public IActionResult ContactMe(string name, string email, string phone, string message) { var sender = new MailgunSender( "sandbox80f23c652d1041e2b2ab7f16a1ec084b.mailgun.org", // Mailgun Domain "key-fffd1ed5730a7c8521ada4bf947be09a" // Mailgun API Key ); Email.DefaultSender = sender; var emailSend = Email .From(email) .To("*****@*****.**") .Subject("Poruka sa sajta") .Body(message + "<br/> Ime: " + name + " <br/> Telefonski broj: " + phone); var response = emailSend.SendAsync(); return(Content(response.ToString())); }
public async Task <SendResponse> Send(string toEmail, string toName, string givePresentTo) { var sender = new MailgunSender( _options.Domain, // Mailgun Domain _options.APIKey, // Mailgun API Key MailGunRegion.EU ); Email.DefaultSender = sender; Email.DefaultRenderer = new RazorRenderer(); string subject = $"Your secret santa selection"; IFluentEmail email = null; try { email = Email .From("*****@*****.**") .To(toEmail, toName) .Subject(subject) .UsingTemplateFromFile($"{Directory.GetCurrentDirectory()}/EmailTemplate.cshtml", new { Name = givePresentTo, GifterName = toName }); } catch (TemplateCompilationException tex) { string body = $"your secret santa present is for {givePresentTo}"; email = Email .From("*****@*****.**") .To(toEmail, toName) .Subject(subject) .UsingTemplateEngine(new ReplaceRenderer()) .Body(string.Format("Hello {0}, <br /> {1} ", toName, body)); string x = tex.Message; } catch (Exception ex) { var x = ex.Message; } var response = await email.SendAsync(); return(response); }
public async Task <SendResponse> SendRegistrationEmail() { var sender = new MailgunSender( "sandbox32e99c74ce19453196efca5157abe0f0.mailgun.org", // Mailgun Domain ApiKey // Mailgun API Key ); Email.DefaultSender = sender; string fromEmail = "*****@*****.**"; string toEmail = "*****@*****.**"; string subject = "LoanToAllah Email Registration"; string body = "Please confirm the email so you can be a part of Allah's work."; var email = Email .From(fromEmail) .To(toEmail) .Subject(subject) .Body(body); return(await email.SendAsync()); }
public async Task SendRecoveryPasswordAsync(string modelEmail, string newPassword) { var sender = new MailgunSender(domainName, apiKey); Email.DefaultSender = sender; var template = "You received this message because you reset your password in the Garnet Travel " + "system. \r\n\n Email address: " + modelEmail + "\r\n Your new password: "******"\r\n\n Sincerely, Garnet Travel Team" + "\r\n (This is an auto generated message, please do not reply!)"; var email = Email .From("*****@*****.**", "GarnetTravel.Support") .To(modelEmail) .Subject($"You reset your password") .UsingTemplate(template, false, false); await email.SendAsync(); }
// This method gets called by the runtime. Use this method to add services to the container. public void ConfigureServices(IServiceCollection services) { services.AddDbContext <AppDbContext>(options => options.UseSqlServer(Configuration.GetConnectionString("DefaultConnection"))); services.AddIdentity <IdentityUser, IdentityRole>().AddEntityFrameworkStores <AppDbContext>(); //Data Access Layer Services services.AddTransient <IGroupDal, GroupDal>(); services.AddTransient <ICustomUserDal, CustomUserDal>(); services.AddTransient <IGroupMembershipDal, GroupMembershipDal>(); services.AddTransient <IGroupRulesDal, GroupRulesDal>(); services.AddTransient <IGroupMessagesDal, GroupMessagesDal>(); services.AddTransient <IMemberConditionsDal, MemberConditionsDal>(); services.AddTransient <ICustomUserDetailsDal, CustomUserDetailsDal>(); services.AddTransient <IGroupPairingsDal, GroupPairingsDal>(); //Test Dependency Injection services.AddTransient <ISecretSantaBl, SecretSantaBl>(); services.AddTransient <IViewRenderService, ViewRenderService>(); // Add authentication services services.AddAuthentication(options => { options.DefaultAuthenticateScheme = CookieAuthenticationDefaults.AuthenticationScheme; options.DefaultSignInScheme = CookieAuthenticationDefaults.AuthenticationScheme; options.DefaultChallengeScheme = CookieAuthenticationDefaults.AuthenticationScheme; }) .AddCookie() .AddOpenIdConnect("Auth0", options => { // Set the authority to your Auth0 domain options.Authority = $"https://{Configuration["Auth0:Domain"]}"; // Configure the Auth0 Client ID and Client Secret options.ClientId = Configuration["Auth0:ClientId"]; options.ClientSecret = Configuration["Auth0:ClientSecret"]; // Set response type to code options.ResponseType = "code"; // Configure the scope options.Scope.Clear(); options.Scope.Add("openid"); options.Scope.Add("profile"); // Set the correct name claim type options.TokenValidationParameters = new TokenValidationParameters { NameClaimType = "name" }; // Set the callback path, so Auth0 will call back to http://localhost:5000/signin-auth0 // Also ensure that you have added the URL as an Allowed Callback URL in your Auth0 dashboard options.CallbackPath = new PathString("/signin-auth0"); // Configure the Claims Issuer to be Auth0 options.ClaimsIssuer = "Auth0"; options.Events = new OpenIdConnectEvents { // handle the logout redirection OnRedirectToIdentityProviderForSignOut = context => { var logoutUri = $"https://{Configuration["Auth0:Domain"]}/v2/logout?client_id={Configuration["Auth0:ClientId"]}"; var postLogoutUri = context.Properties.RedirectUri; if (!string.IsNullOrEmpty(postLogoutUri)) { if (postLogoutUri.StartsWith("/")) { // transform to absolute var request = context.Request; postLogoutUri = request.Scheme + "://" + request.Host + request.PathBase + postLogoutUri; } logoutUri += $"&returnTo={Uri.EscapeDataString(postLogoutUri)}"; } context.Response.Redirect(logoutUri); context.HandleResponse(); return(Task.CompletedTask); } }; }); // Add framework services. services.AddMvc(); services.AddSingleton <IConfiguration>(Configuration); //var testtest = Configuration["TestMe:TestOne"]; //var testthree = Configuration["TestMe:TestTwo"]; //options.ClientId = Configuration["Auth0:ClientId"]; //options.ClientSecret = Configuration["Auth0:ClientSecret"]; //session and cache services.AddDistributedMemoryCache(); // Adds a default in-memory implementation of IDistributedCache services.AddSession(); // Add functionality to inject IOptions<T> services.AddOptions(); //MailGun var domain = Configuration["MailGun:Domain"]; var mgkey = Configuration["MailGun:ApiKey"]; var sender = new MailgunSender( domain, // Mailgun Domain mgkey // Mailgun API Key ); Email.DefaultSender = sender; //auth0 }
// This method gets called by the runtime. Use this method to add services to the container. // For more information on how to configure your application, visit https://go.microsoft.com/fwlink/?LinkID=398940 public void ConfigureServices(IServiceCollection services) { services.AddAuthentication(o => { o.DefaultAuthenticateScheme = JwtBearerDefaults.AuthenticationScheme; o.DefaultChallengeScheme = JwtBearerDefaults.AuthenticationScheme; }).AddFacebook(o => { o.AppId = Configuration["Authentication:Facebook:AppId"]; o.AppSecret = Configuration["Authentication:Facebook:AppSecret"]; }).AddGoogle(o => { o.ClientId = Configuration["Authentication:Google:ClientId"]; o.ClientSecret = Configuration["Authentication:Google:ClientSecret"]; o.UserInformationEndpoint = "https://www.googleapis.com/oauth2/v2/userinfo"; o.ClaimActions.Clear(); o.ClaimActions.MapJsonKey(ClaimTypes.NameIdentifier, "id"); o.ClaimActions.MapJsonKey(ClaimTypes.Name, "name"); o.ClaimActions.MapJsonKey(ClaimTypes.GivenName, "given_name"); o.ClaimActions.MapJsonKey(ClaimTypes.Surname, "family_name"); o.ClaimActions.MapJsonKey("urn:google:profile", "link"); o.ClaimActions.MapJsonKey(ClaimTypes.Email, "email"); }).AddJwtBearer(o => { o.Audience = Configuration.GetSection("Authentication:Jwt:SiteUrl").Value; //o.Authority = Configuration.GetSection("Authentication:Jwt:SiteUrl").Value; o.ClaimsIssuer = Configuration.GetSection("Authentication:Jwt:SiteUrl").Value; o.RequireHttpsMetadata = false; o.IncludeErrorDetails = true; o.SaveToken = true; o.TokenValidationParameters = new TokenValidationParameters { //ValidateIssuerSigningKey = true, IssuerSigningKey = new SymmetricSecurityKey(Encoding.UTF8.GetBytes(Configuration.GetSection("Authentication:Jwt:Key").Value)), //ValidateIssuer = true, ValidIssuer = Configuration.GetSection("Authentication:Jwt:SiteUrl").Value, //ValidateAudience = true, ValidAudience = Configuration.GetSection("Authentication:Jwt:SiteUrl").Value, //ValidateLifetime = true, //ClockSkew = TimeSpan.FromMinutes(1) }; }); services.AddDbContext <UserContext>(options => { options.UseSqlServer(Configuration.GetSection(ConnectionStringKey).Value); }); services.AddIdentity <User, Role>() .AddEntityFrameworkStores <UserContext>() .AddDefaultTokenProviders(); services.Configure <IdentityOptions>(options => { options.User.RequireUniqueEmail = false; options.User.AllowedUserNameCharacters += "едц≈ƒ÷"; options.Password.RequireDigit = false; options.Password.RequireLowercase = false; options.Password.RequireNonAlphanumeric = false; options.Password.RequireUppercase = false; //options.Cookies.ApplicationCookie.CookieHttpOnly = false; }); services.AddAuthorization(); /* * services.Configure<MvcOptions>(options => * { * options.Filters.Add((new CorsAuthorizationFilterFactory("ApiCorsPolicy")); * }); */ var corsPolicy = new CorsPolicyBuilder() .AllowAnyHeader() .AllowAnyMethod() .AllowAnyOrigin() .Build(); services.AddCors(options => { options.AddPolicy("ApiCorsPolicy", corsPolicy); }); services.AddAntiforgery(options => options.HeaderName = "X-CSRF-TOKEN"); services.AddMvc(); services.AddTransient <INutritionRepository>(s => { return(new NutritionRepository(Configuration.GetSection(ConnectionStringKey).Value)); }); services.AddTransient <ITrainingRepository>(s => { return(new TrainingRepository(Configuration.GetSection(ConnectionStringKey).Value)); }); services.AddTransient <IMeasurementRepository>(s => { return(new MeasurementRepository(Configuration.GetSection(ConnectionStringKey).Value)); }); services.AddTransient <IProfileRepository>(s => { return(new ProfileRepository(Configuration.GetSection(ConnectionStringKey).Value)); }); services.AddTransient <ILogRepository>(s => { return(new LogRepository(Configuration.GetSection(ConnectionStringKey).Value)); }); services.AddTransient <IFeedbackRepository>(s => { return(new FeedbackRepository(Configuration.GetSection(ConnectionStringKey).Value)); }); services.AddTransient <IActivityRepository>(s => { return(new ActivityRepository(Configuration.GetSection(ConnectionStringKey).Value)); }); services.AddTransient <ISettingsRepository>(s => { return(new SettingsRepository(Configuration.GetSection(ConnectionStringKey).Value)); }); var sender = new MailgunSender(Configuration.GetSection("MailGun:Domain").Value, Configuration.GetSection("MailGun:ApiKey").Value, MailGunRegion.EU); services.AddSingleton <ISender>(sender); services.AddAutoMapper(typeof(Mappings)); }
public void SetUp() { var sender = new MailgunSender("sandboxcf5f41bbf2f84f15a386c60e253b5fe9.mailgun.org", "key-8d32c046d7f14ada8d5ba8253e3e30de"); Email.DefaultSender = sender; }
public EmailService(MailgunSender mailgunSender, ISendGridClient sendGridClient, ILogger <EmailService> logger) { _mailgunSender = mailgunSender; _sendGridClient = sendGridClient; _logger = logger; }
public Emailer(IOptions <EmailConfig> emailOptions) { var emailConfig = emailOptions.Value; _sender = new MailgunSender(emailConfig.Domain, emailConfig.Secret); }