コード例 #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ProcessNotificationQueueItem"/> class.
 /// </summary>
 /// <param name="logger">The log.</param>
 /// <param name="configuration">The configuration.</param>
 /// <param name="repositoryFactory">The repositoryFactory.</param>
 /// <param name="httpClientHelper">The httpClientHelper.</param>
 public ProcessNotificationQueueItem(
     ILogger logger,
     IConfiguration configuration,
     IRepositoryFactory repositoryFactory,
     IHttpClientHelper httpClientHelper)
 {
     this.logger        = logger;
     this.configuration = configuration;
     this.emailNotificationRepository = repositoryFactory.GetRepository(Enum.TryParse <StorageType>(this.configuration?[Constants.StorageType], out this.repo) ? this.repo : throw new Exception());
     this.httpClientHelper            = httpClientHelper;
 }
コード例 #2
0
 public EmailNotifierService(
     ISessionProvider sessionProvider,
     Settings settings,
     Logger logger,
     IEmailNotificationRepository emailNotificationRepository)
 {
     _sessionProvider             = sessionProvider;
     _settings                    = settings;
     _logger                      = logger;
     _emailNotificationRepository = emailNotificationRepository;
     InitializeComponent();
     _processing = false;
 }
コード例 #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="NotificationReportManager"/> class.
 /// <param name="logger">An instance of <see cref="ILogger"/>.</param>
 /// <param name="repositoryFactory">An instance of <see cref="IRepositoryFactory"/>.</param>
 /// <param name="configuration">An instance of <see cref="IConfiguration"/>.</param>
 /// <param name="emailManager">An instance of <see cref="EmailManager"/>.</param>
 /// <param name="mailTemplateRepository">An instance of <see cref="IMailTemplateRepository"/>.</param>
 public NotificationReportManager(
     ILogger logger,
     IRepositoryFactory repositoryFactory,
     IConfiguration configuration,
     IEmailManager emailManager,
     IMailTemplateRepository mailTemplateRepository)
 {
     this.logger        = logger;
     this.configuration = configuration;
     this.emailNotificationRepository = this.emailNotificationRepository = repositoryFactory.GetRepository(Enum.TryParse <StorageType>(this.configuration?[NotificationService.Common.Constants.StorageType], out this.repo) ? this.repo : throw new Exception("Unknown Database Type"));
     this.emailManager           = emailManager;
     this.mailTemplateRepository = mailTemplateRepository ?? throw new System.ArgumentNullException(nameof(mailTemplateRepository));
 }
コード例 #4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="EmailManager"/> class.
 /// </summary>
 /// <param name="configuration">An instance of <see cref="IConfiguration"/>.</param>
 /// <param name="repositoryFactory">An instance of <see cref="IRepositoryFactory"/>.</param>
 /// <param name="logger">Instance of Logger.</param>
 /// <param name="templateManager">Instance of templateManager.</param>
 /// <param name="templateMerge">Instance of templateMerge.</param>
 public EmailManager(
     IConfiguration configuration,
     IRepositoryFactory repositoryFactory,
     ILogger logger,
     IMailTemplateManager templateManager,
     ITemplateMerge templateMerge)
 {
     this.repositoryFactory           = repositoryFactory;
     this.configuration               = configuration;
     this.emailNotificationRepository = repositoryFactory.GetRepository(Enum.TryParse <StorageType>(this.configuration?[Constants.StorageType], out this.repo) ? this.repo : throw new Exception());
     this.logger          = logger;
     this.templateManager = templateManager;
     this.templateMerge   = templateMerge;
 }
コード例 #5
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ProcessNotificationQueueItem"/> class.
        /// </summary>
        /// <param name="logger">The log.</param>
        /// <param name="configuration">The configuration.</param>
        /// <param name="repositoryFactory">The repositoryFactory.</param>
        /// <param name="httpClientHelper">The httpClientHelper.</param>
        /// <param name="refresherProvider">The IConfigurationRefresherProvider.</param>
        public ProcessNotificationQueueItem(
            ILogger logger,
            IConfiguration configuration,
            IRepositoryFactory repositoryFactory,
            IHttpClientHelper httpClientHelper,
            IConfigurationRefresherProvider refresherProvider)
        {
            this.logger        = logger;
            this.configuration = configuration;
            this.emailNotificationRepository = repositoryFactory.GetRepository(Enum.TryParse <StorageType>(this.configuration?[Constants.StorageType], out this.repo) ? this.repo : throw new Exception());
            this.httpClientHelper            = httpClientHelper;
            this.configurationRefresher      = refresherProvider.Refreshers.First();

            //No need to await
            RefreshKeys();
        }
コード例 #6
0
        /// <summary>
        /// Initializes a new instance of the <see cref="EmailServiceManager"/> class.
        /// </summary>
        /// <param name="configuration">An instance of <see cref="IConfiguration"/>.</param>
        /// <param name="repositoryFactory">An instance of <see cref="IRepositoryFactory"/>.</param>
        /// <param name="cloudStorageClient">An instance of <see cref="ICloudStorageClient"/>.</param>
        /// <param name="logger">Instance of Logger.</param>
        /// <param name="notificationProviderFactory">An instance of <see cref="INotificationProviderFactory"/>.</param>
        /// <param name="emailManager">An instance of <see cref="IEmailManager"/>.</param>
        public EmailServiceManager(
            IConfiguration configuration,
            IRepositoryFactory repositoryFactory,
            ICloudStorageClient cloudStorageClient,
            ILogger logger,
            INotificationProviderFactory notificationProviderFactory,
            IEmailManager emailManager)
        {
            this.repositoryFactory           = repositoryFactory;
            this.configuration               = configuration;
            this.emailNotificationRepository = repositoryFactory.GetRepository(Enum.TryParse <StorageType>(this.configuration?[Constants.StorageType], out this.repo) ? this.repo : throw new Exception());
            this.cloudStorageClient          = cloudStorageClient;
            this.logger = logger;
            this.notificationProvider = notificationProviderFactory.GetNotificationProvider(Enum.TryParse <NotificationProviderType>(this.configuration?[Constants.NotificationProviderType], out this.provider) ? this.provider : throw new Exception());
            if (this.configuration?["MailSettings"] != null)
            {
                this.mailSettings = JsonConvert.DeserializeObject <List <MailSettings> >(this.configuration?["MailSettings"]);
            }

            this.emailManager = emailManager;
        }
コード例 #7
0
 public MailService(IEmailNotificationRepository emailRepository)
 {
     this.EmailRepository = emailRepository;
 }
コード例 #8
0
 public MailService(IEmailNotificationRepository emailRepository)
 {
     this.EmailRepository = emailRepository;
 }
コード例 #9
0
 public BookingController(IBookingRepository bookingRepository, IEmailNotificationRepository emailNotificationRepository, IBlockedDateRepository blockedDateRepository)
 {
     this.bookingRepository           = bookingRepository;
     this.emailNotificationRepository = emailNotificationRepository;
     this.blockedDateRepository       = blockedDateRepository;
 }
コード例 #10
0
 public EmailNotificationCrashProcessor(string recepients, IEmailNotificationRepository emailNotificationRepository)
 {
     _recepients = recepients;
     _emailNotificationRepository = emailNotificationRepository;
 }