public Worker( ILogger <Worker> logger, ISMTPClient smtpClient, IDatabaseClient databaseClient, IMailTemplateManager mailTemplateManager, IConfiguration configuration) { _logger = logger; _smtpClient = smtpClient; _databaseClient = databaseClient; _mailTemplateManager = mailTemplateManager; _configuration = configuration; }
/// <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; }
/// <summary> /// Initializes a new instance of the <see cref="NotificationReportManager"/> class. /// </summary> /// <param name="logger">The logger.</param> /// <param name="repositoryFactory">The repository factory.</param> /// <param name="configuration">The configuration.</param> /// <param name="mailTemplateRepository">The mail template repository.</param> /// <param name="templateManager">The template manager.</param> /// <param name="templateMerge">The template merge.</param> /// <exception cref="Exception">Unknown Database Type.</exception> /// <exception cref="System.ArgumentNullException">mailTemplateRepository.</exception> public NotificationReportManager( ILogger logger, IRepositoryFactory repositoryFactory, IConfiguration configuration, IMailTemplateRepository mailTemplateRepository, IMailTemplateManager templateManager, ITemplateMerge templateMerge) { this.logger = logger; this.configuration = configuration; this.emailNotificationRepository = repositoryFactory?.GetRepository(Enum.TryParse <StorageType>(this.configuration?[ConfigConstants.StorageType], out this.repo) ? this.repo : throw new Exception("Unknown Database Type")); this.templateManager = templateManager; this.templateMerge = templateMerge; this.mailTemplateRepository = mailTemplateRepository ?? throw new System.ArgumentNullException(nameof(mailTemplateRepository)); }
/// <summary> /// Initializes a new instance of the <see cref="EmailController"/> class. /// </summary> /// <param name="emailHandlerManager">An instance of <see cref="EmailManager"/>.</param> /// <param name="templateManager">An instance of <see cref="MailTemplateManager"/>.</param> /// <param name="logger">An instance of <see cref="ILogger"/>.</param> /// <param name="correlationProvider">An instance of <see cref="ICorrelationProvider"/>.</param> public EmailController(IEmailHandlerManager emailHandlerManager, IMailTemplateManager templateManager, ILogger logger) : base(logger) { this.emailHandlerManager = emailHandlerManager ?? throw new System.ArgumentNullException(nameof(emailHandlerManager)); this.templateManager = templateManager ?? throw new ArgumentNullException(nameof(templateManager)); }