Esempio n. 1
0
        public SparkpostEmailService(IOptions <SparkpostSettings> sparkpostSettings, IMjmlServices mjmlServices)
        {
            _mjmlServices = mjmlServices;

            _sparkpostSettings = sparkpostSettings.Value;

            _client = new SmtpClient(_sparkpostSettings.Host, _sparkpostSettings.Port)
            {
                Credentials = new NetworkCredential(_sparkpostSettings.UserName, _sparkpostSettings.Password), EnableSsl = true
            };

            _refundAddress = new MailAddress(_sparkpostSettings.RefundAddress, "CAES UC Davis Refunds");
        }
Esempio n. 2
0
 /// <summary>
 /// .ctor
 /// </summary>
 public EmailService(ILogger <EmailService> logger,
                     IOurGardenRepository repository,
                     IMjmlServices mjmlServices,
                     IOptions <EmailServiceConfigurationOptions> emailOption,
                     IOptions <RootOptions> rootOptions,
                     IEmailSender emailSender)
 {
     _logger              = logger;
     _repository          = repository;
     _mjmlServices        = mjmlServices;
     _emailServiceOptions = emailOption.Value;
     _rootOptions         = rootOptions.Value;
     _emailSender         = emailSender;
 }
Esempio n. 3
0
 public MemoriesService(IConfiguration configuration,
                        IMjmlServices mjmlServices,
                        IAccountService accountService,
                        ISqLiteService sqLiteService,
                        ISendGridClient sendGridClient,
                        ILogger <MemoriesService> logger)
 {
     _configuration  = configuration;
     _mjmlServices   = mjmlServices;
     _accountService = accountService;
     _sqLiteService  = sqLiteService;
     _sendGridClient = sendGridClient;
     _logger         = logger;
 }
Esempio n. 4
0
        public void Setup()
        {
            var services = new ServiceCollection();

            services.AddMjmlServices(o =>
            {
                o.DefaultBeautify     = false;
                o.DefaultKeepComments = true;
                o.DefaultMinify       = false;
            });

            var provider = services.BuildServiceProvider();

            _mjmlServices = provider.GetRequiredService <IMjmlServices>();
        }
Esempio n. 5
0
        public EmailService(IWebHostEnvironment environment, IOptions <SparkpostSettings> emailSettings, IMjmlServices mjmlServices, TacoDbContext dbContext, UserManager <User> userManager)
        {
            _isDevelopment = environment.IsDevelopment();

            _emailSettings = emailSettings.Value;

            _mjmlServices = mjmlServices;
            _dbContext    = dbContext;
            _userManager  = userManager;

            _client = new SmtpClient(_emailSettings.Host, _emailSettings.Port)
            {
                Credentials = new NetworkCredential(_emailSettings.UserName, _emailSettings.Password), EnableSsl = true
            };
        }
Esempio n. 6
0
        public EmailFormatter(IImageFormatter imageFormatter, IMjmlServices mjmlServices)
        {
            this.imageFormatter = imageFormatter;

            this.mjmlServices = mjmlServices;
        }