/// <summary>
 /// Initializes a new instance of the <see cref="UserProfileService"/> class.
 /// </summary>
 /// <param name="logger">Injected Logger Provider.</param>
 /// <param name="userProfileDelegate">The profile delegate to interact with the DB.</param>
 /// <param name="userPreferenceDelegate">The preference delegate to interact with the DB.</param>
 /// <param name="emailDelegate">The email delegate to interact with the DB.</param>
 /// <param name="emailInviteDelegate">The email invite delegate to interact with the DB.</param>
 /// <param name="configuration">The configuration service.</param>
 /// <param name="emailQueueService">The email service to queue emails.</param>
 /// <param name="legalAgreementDelegate">The terms of service delegate.</param>
 /// <param name="cryptoDelegate">Injected Crypto delegate.</param>
 /// <param name="notificationSettingsService">Notification settings delegate.</param>
 /// <param name="messageVerificationDelegate">The message verification delegate to interact with the DB.</param>
 /// <param name="patientService">The patient service.</param>
 public UserProfileService(
     ILogger <UserProfileService> logger,
     IUserProfileDelegate userProfileDelegate,
     IUserPreferenceDelegate userPreferenceDelegate,
     IEmailDelegate emailDelegate,
     IMessagingVerificationDelegate emailInviteDelegate,
     IConfigurationService configuration,
     IEmailQueueService emailQueueService,
     ILegalAgreementDelegate legalAgreementDelegate,
     ICryptoDelegate cryptoDelegate,
     INotificationSettingsService notificationSettingsService,
     IMessagingVerificationDelegate messageVerificationDelegate,
     IPatientService patientService)
 {
     this.logger = logger;
     this.userProfileDelegate         = userProfileDelegate;
     this.userPreferenceDelegate      = userPreferenceDelegate;
     this.emailDelegate               = emailDelegate;
     this.emailInviteDelegate         = emailInviteDelegate;
     this.configurationService        = configuration;
     this.emailQueueService           = emailQueueService;
     this.legalAgreementDelegate      = legalAgreementDelegate;
     this.cryptoDelegate              = cryptoDelegate;
     this.notificationSettingsService = notificationSettingsService;
     this.messageVerificationDelegate = messageVerificationDelegate;
     this.patientService              = patientService;
 }
Exemplo n.º 2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="DeleteEmailJob"/> class.
        /// </summary>
        /// <param name="configuration">The configuration to use.</param>
        /// <param name="logger">The logger to use.</param>
        /// <param name="emailDelegate">The email delegate to use.</param>
        public DeleteEmailJob(IConfiguration configuration, ILogger <EmailJob> logger, IEmailDelegate emailDelegate)
        {
            this.configuration = configuration !;
            this.logger        = logger;
            this.emailDelegate = emailDelegate !;
            IConfigurationSection section = configuration !.GetSection("Smtp");

            section              = configuration.GetSection("DeleteEmailJob");
            this.deleteMaxRows   = section.GetValue <int>("DeleteMaxRows", 1000);
            this.deleteAfterDays = section.GetValue <uint>("DeleteAfterDays", 30);
        }
Exemplo n.º 3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="EmailQueueService"/> class.
 /// </summary>
 /// <param name="logger">The injected logger provider.</param>
 /// <param name="jobClient">The JobScheduler queue client.</param>
 /// <param name="emailDelegate">Email delegate to be used.</param>
 /// <param name="environment">The injected environment configuration.</param>
 public EmailQueueService(
     ILogger <EmailQueueService> logger,
     IBackgroundJobClient jobClient,
     IEmailDelegate emailDelegate,
     IWebHostEnvironment environment)
 {
     this.logger        = logger;
     this.jobClient     = jobClient;
     this.emailDelegate = emailDelegate;
     this.environment   = environment;
 }
Exemplo n.º 4
0
        /// <summary>
        /// Initializes a new instance of the <see cref="EmailJob"/> class.
        /// </summary>
        /// <param name="configuration">The configuration to use.</param>
        /// <param name="logger">The logger to use.</param>
        /// <param name="emailDelegate">The email delegate to use.</param>
        public EmailJob(IConfiguration configuration, ILogger <EmailJob> logger, IEmailDelegate emailDelegate)
        {
            Contract.Requires((configuration != null) && (emailDelegate != null));
            this.logger        = logger;
            this.emailDelegate = emailDelegate !;
            IConfigurationSection section = configuration !.GetSection("Smtp");

            this.host           = section.GetValue <string>("Host");
            this.port           = section.GetValue <int>("Port");
            section             = configuration.GetSection("EmailJob");
            this.maxRetries     = section.GetValue <int>("MaxRetries", 9);
            this.retryFetchSize = section.GetValue <int>("MaxRetryFetchSize", 250);
        }
Exemplo n.º 5
0
        /// <summary>
        /// Initializes a new instance of the <see cref="EmailAdminService"/> class.
        /// </summary>
        /// <param name="configuration">Injected configuration provider.</param>
        /// <param name="logger">Injected Logger Provider.</param>
        /// <param name="emailDelegate">The email delegate to interact with the DB.</param>
        /// <param name="emailInviteDelegate">The email invite delegate to interact with the DB.</param>
        public EmailAdminService(
            IConfiguration configuration,
            ILogger <EmailAdminService> logger,
            IEmailDelegate emailDelegate,
            IMessagingVerificationDelegate emailInviteDelegate)
        {
            this.configuration       = configuration;
            this.logger              = logger;
            this.emailDelegate       = emailDelegate;
            this.emailInviteDelegate = emailInviteDelegate;
            IConfigurationSection section = configuration !.GetSection(EmailAdminSectionConfigKey);

            this.maxEmails = section.GetValue <int>(MaxEmailsConfigKey, DefaultMaxEmails);
        }