public OrderController(IUnitOfWorkFactory unitOfWorkFactory, IGetOrderMapper getOrderMapper, IOrderService orderService, IThemeContentProvider themeContentProvider, IEmailTemplateRenderer emailTemplateRenderer) : base(unitOfWorkFactory)
 {
     this.GetOrderMapper        = getOrderMapper;
     this.OrderService          = orderService;
     this.ThemeContentProvider  = themeContentProvider;
     this.EmailTemplateRenderer = emailTemplateRenderer;
 }
 public InvoiceController(IUnitOfWorkFactory unitOfWorkFactory, IGetInvoiceMapper getInvoiceMapper, IInvoiceService invoiceService, IThemeContentProvider themeContentProvider, IEmailTemplateRenderer emailTemplateRenderer)
     : base(unitOfWorkFactory)
 {
     this.GetInvoiceMapper      = getInvoiceMapper;
     this.InvoiceService        = invoiceService;
     this.ThemeContentProvider  = themeContentProvider;
     this.EmailTemplateRenderer = emailTemplateRenderer;
 }
Exemplo n.º 3
0
 public AccountsController(IIdentityGateway identityGateway,
                           IUserRepository userRepository,
                           IEmailSender emailSender,
                           ILogRepository logRepository,
                           IRoleRepository roleRepository,
                           IEmailTemplateRenderer emailTemplateRenderer
                           ) : base(identityGateway)
 {
     _identityGateway       = identityGateway;
     _userRepository        = userRepository;
     _emailSender           = emailSender;
     _logRepository         = logRepository;
     _roleRepository        = roleRepository;
     _emailTemplateRenderer = emailTemplateRenderer;
 }
Exemplo n.º 4
0
        public EmailSender(EmailOptions options, IEmailClient client, IEmailTemplateRenderer?templateRenderer = null)
        {
            if (options == null)
            {
                throw new ArgumentNullException(nameof(options));
            }
            if (client == null)
            {
                throw new ArgumentNullException(nameof(client));
            }

            _options          = options;
            _client           = client;
            _templateRenderer = templateRenderer ?? new ReplaceEmailTemplateRenderer();
        }
Exemplo n.º 5
0
        public JobRunner(ILogRepository logRepository,
                         IUserRepository userRepository,
                         IEmailSender emailSender,
                         IErrorRepository errorRepository,
                         INotificationRepository notificationRepository,
                         IEmailTemplateRenderer emailTemplateRenderer)
        {
            _logRepository          = logRepository;
            _userRepository         = userRepository;
            _emailSender            = emailSender;
            _errorRepository        = errorRepository;
            _notificationRepository = notificationRepository;
            _emailTemplateRenderer  = emailTemplateRenderer;

            var digestStartConfig = AppDeployment.Instance.AppSetting(ConfigurationManager.AppSettings["DailyDigestEmailTime"], "00:00");

            if (!TimeSpan.TryParseExact(digestStartConfig, @"hh\:mm", CultureInfo.InvariantCulture, out _digestStart))
            {
                throw new Exception("Cannot parse start time for digest email task.");
            }
        }
 /// <summary>
 /// Creates a new instance of this repository
 /// </summary>
 /// <param name="dbContext">The persistance context to be used when accessing templates</param>
 /// <param name="emailRepository">An IRepository information used to persist generated email messages</param>
 /// <param name="emailRenderer">An IEmailRenderer implementation used to bind the template as well as output HTML</param>
 /// <param name="messageBus">An optional message bus for sending EmailTemplate messages</param>
 public EmailTemplateRepository(IPersistenceContext <EmailTemplate> dbContext, IQueueAndSendMail emailRepository, IEmailTemplateRenderer emailRenderer, MessageBus messageBus = null) : base(dbContext, messageBus)
 {
     this.EmailRenderer   = emailRenderer;
     this.EmailRepository = emailRepository;
 }
Exemplo n.º 7
0
 public SendGridEmailSender(IOptionsMonitor <SendGridOptions> optionsAccessor, ISendGridClient client, IEmailTemplateRenderer renderer)
 {
     _options  = optionsAccessor?.CurrentValue ?? throw new ArgumentNullException(nameof(optionsAccessor));
     _client   = client ?? throw new ArgumentNullException(nameof(client));
     _renderer = renderer ?? throw new ArgumentNullException(nameof(renderer));
 }