Exemple #1
0
 public ActivationIntegrationEventHandler(IActivationRepository repository, IActivationFactory factory, IUnitOfWork <ILedgerActivationDbAbstraction> unitOfWork, IEmailDispatcher emailDispatcher)
 {
     _unitOfWork      = unitOfWork;
     _repository      = repository;
     _factory         = factory;
     _emailDispatcher = emailDispatcher;
 }
 public CustomerCheckedOutHandle(IEmailGenerator emailGenerator,
                                 IEmailDispatcher emailSender, ICustomerRepository customerRepository)
 {
     this.emailDispatcher    = emailSender;
     this.emailGenerator     = emailGenerator;
     this.customerRepository = customerRepository;
 }
Exemple #3
0
 public EmailService(INotificationSettingsRepository notificationSettingsRepository, IEmailDispatcher emailDispatcher, ICurrentMarket currentMarket, IContentLoader contentLoader)
 {
     _notificationSettingsRepository = notificationSettingsRepository;
     _emailDispatcher = emailDispatcher;
     _currentMarket   = currentMarket;
     _contentLoader   = contentLoader;
 }
Exemple #4
0
 public EmailOutbox(IEmailDispatcher dispatcher, IMailMessageCreator messageCreator, IEmailRepository repository, ILogger <EmailOutbox> log)
 {
     Dispatcher     = dispatcher;
     MessageCreator = messageCreator;
     Repository     = repository;
     Log            = log;
 }
        public void SetUp()
        {
            IEnumerable <KeyValuePair <MessageTypes, EmailMessageFormatter> > emailMessageFormatters = new[]
            {
                new KeyValuePair <MessageTypes, EmailMessageFormatter>(MessageTypes.EmployerEnquiry, new EmailSimpleMessageFormatter()),
                new KeyValuePair <MessageTypes, EmailMessageFormatter>(MessageTypes.EmployerEnquiryConfirmation, new EmailSimpleMessageFormatter()),
                new KeyValuePair <MessageTypes, EmailMessageFormatter>(MessageTypes.GlaEmployerEnquiry, new EmailSimpleMessageFormatter()),
                new KeyValuePair <MessageTypes, EmailMessageFormatter>(MessageTypes.GlaEmployerEnquiryConfirmation, new EmailSimpleMessageFormatter()),
                new KeyValuePair <MessageTypes, EmailMessageFormatter>(MessageTypes.WebAccessRequest, new EmailSimpleMessageFormatter()),
                new KeyValuePair <MessageTypes, EmailMessageFormatter>(MessageTypes.WebAccessRequestConfirmation, new EmailSimpleMessageFormatter())
            };

            var container = new Container(x =>
            {
                x.For <IConfigurationManager>().Singleton().Use <ConfigurationManager>();

                x.For <IEmailDispatcher>().Use <SendGridEmailDispatcher>().Named("SendGridEmailDispatcher").Ctor <IEnumerable <KeyValuePair <MessageTypes, EmailMessageFormatter> > >()
                .Is(emailMessageFormatters);
                x.For <IEmailDispatcher>().Use <VoidEmailDispatcher>().Name = "VoidEmailDispatcher";
                x.For <SendGridConfiguration>().Singleton().Use(SendGridConfiguration.Instance);
                x.For <IEmailDispatcher>().Use <VoidEmailDispatcher>().Name = "VoidEmailDispatcher";
            });

            container.Configure(c => c.For <ILogService>().Use(_logServiceMock.Object));
            container.Configure(c => c.For <IXmlGenerator>().Use(_xmlGeneratorMock.Object));

            _dispatcher          = container.GetInstance <IEmailDispatcher>("SendGridEmailDispatcher");
            _voidEmailDispatcher = container.GetInstance <IEmailDispatcher>("VoidEmailDispatcher");
        }
 public EmailService(INotificationSettingsRepository notificationSettingsRepository, IEmailDispatcher emailDispatcher, ICurrentMarket currentMarket, IContentLoader contentLoader, IMarketService marketService)
 {
     _notificationSettingsRepository = notificationSettingsRepository;
     _emailDispatcher = emailDispatcher;
     _currentMarket = currentMarket;
     _contentLoader = contentLoader;
     _marketService = marketService;
 }
Exemple #7
0
 public AccountsController(RCMUserManager rcmUserManager, RCMSignInManager rcmSignInManager, IDomainNotificationHandler domainNotificationHandler, IHttpContextAccessor httpContextAccessor, IEmailGenerator emailGenerator, IEmailDispatcher emailDispatcher) : base(domainNotificationHandler)
 {
     _rcmUserManager      = rcmUserManager;
     _rcmSignInManager    = rcmSignInManager;
     _httpContextAccessor = httpContextAccessor;
     _emailGenerator      = emailGenerator;
     _emailDispatcher     = emailDispatcher;
 }
Exemple #8
0
 public TenantCreatedHandler(MessageGenerator <EmailTemplate, EmailMessage> emailMsgGenerator,
                             IEmailDispatcher emailDispatcher,
                             IConfigurationProvider configProvider)
 {
     this.emailMsgGenerator = emailMsgGenerator;
     this.emailDispatcher   = emailDispatcher;
     this.configProvider    = configProvider;
 }
Exemple #9
0
 public EmailOutbox(IEmailDispatcher dispatcher,
                    IMailMessageCreator messageCreator,
                    IDatabase database, IConfiguration config, ILogger <EmailOutbox> log)
 {
     Dispatcher     = dispatcher;
     MessageCreator = messageCreator;
     Database       = database;
     Config         = config.GetSection("Email").Get <EmailConfiguration>();
     Log            = log;
 }
Exemple #10
0
 public SendVerificationEmailHandler(
     ILogger <GetUserProvidersHandler> logger,
     UserManager <AppUser> userManager,
     IEmailTemplateGenerator emailTemplateGenerator,
     IEmailDispatcher emailDispatcher
     )
 {
     _logger                 = logger;
     _userManager            = userManager;
     _emailTemplateGenerator = emailTemplateGenerator;
     _emailDispatcher        = emailDispatcher;
 }
Exemple #11
0
 public ForgotPasswordHandler(
     ILogger <GetUserProvidersHandler> logger,
     UserManager <Models.AppUser> userManager,
     IEmailDispatcher emailDispatcher,
     IEmailTemplateGenerator emailTemplateGenerator
     )
 {
     _logger                 = logger;
     _userManager            = userManager;
     _emailDispatcher        = emailDispatcher;
     _emailTemplateGenerator = emailTemplateGenerator;
 }
Exemple #12
0
 public EmailOutbox(IEmailDispatcher dispatcher,
                    IMailMessageCreator messageCreator,
                    IDatabase database, IConfiguration config, ILogger <EmailOutbox> log)
 {
     Dispatcher     = dispatcher;
     MessageCreator = messageCreator;
     Database       = database;
     Config         = config.GetSection("Email").Get <EmailConfiguration>();
     Log            = log;
     Sending        = new AsyncEvent <EmailSendingEventArgs>();
     Sent           = new AsyncEvent <EmailSendingEventArgs>();
     SendError      = new AsyncEvent <EmailSendingEventArgs>();
 }
Exemple #13
0
        public void SetUp()
        {
            var container = new Container(x =>
            {
                x.AddRegistry <CommonRegistry>();
                x.AddRegistry <CommunicationRegistry>();
            });

            container.Configure(c => c.For <ILogService>().Use(_logServiceMock.Object));

            _dispatcher = container.GetInstance <IEmailDispatcher>("SendGridEmailDispatcher");
            _logServiceMock.ResetCalls();
        }
Exemple #14
0
        /// <summary>
        /// Initializes a new instance of the <see cref="DefaultMailer"/> class.
        /// </summary>
        /// <param name="dispatcher">
        /// The dispatcher.
        /// </param>
        public DefaultMailer(IEmailDispatcher dispatcher)
        {
            var container = DependencyResolver.Current.GetService <IContainer>();

            config     = container.GetInstance <IConfigService>();
            jobManager = container.GetInstance <IJobManager>();

            mailerEngine = new RazorMailerEngine(
                @"Views\EmailTemplates",
                config.DefaultEmailAddress,
                config.DefaultEmailName,
                dispatcher);
        }
 public RegisterUserHandler(
     UserManager <Models.AppUser> userManager,
     SignInManager <Models.AppUser> signInManager,
     ILogger <RegisterUserHandler> logger,
     IEmailTemplateGenerator emailTemplateGenerator,
     IEmailDispatcher emailDispatcher)
 {
     _userManager            = userManager;
     _signInManager          = signInManager;
     _logger                 = logger;
     _emailTemplateGenerator = emailTemplateGenerator;
     _emailDispatcher        = emailDispatcher;
 }
Exemple #16
0
 public ExecuteRequestJob(ILogger <ExecuteRequestJob> logger,
                          IMediator mediator,
                          [KeyFilter(CubesConstants.Serializer_YAML)] ISerializer serializer,
                          ITypeResolver typeResolver,
                          IEmailDispatcher emailDispatcher,
                          IOptionsSnapshot <SmtpSettingsProfiles> options)
 {
     this.logger          = logger;
     this.mediator        = mediator;
     this.serializer      = serializer;
     this.typeResolver    = typeResolver;
     this.emailDispatcher = emailDispatcher;
     this.smtpProfiles    = options.Value;
 }
Exemple #17
0
 public UserInvitedHandler(MessageGenerator <EmailTemplate, EmailMessage> emailMsgGenerator,
                           IEmailDispatcher emailDispatcher,
                           IConfigurationProvider configurationProvider,
                           IRepository <User> userRepository,
                           IRepository <Tenant> tenantRepository,
                           TenantContext tenantContext)
 {
     this.emailMsgGenerator = emailMsgGenerator;
     this.emailDispatcher   = emailDispatcher;
     this.configProvider    = configurationProvider;
     this.userRepository    = userRepository;
     this.tenantRepository  = tenantRepository;
     this.tenantContext     = tenantContext;
 }
        /// <summary>
        /// Constructs a RazorMailerEngine instance responsible for converting Razor templates into either a MailMessage or string.
        /// <para /> N.B. As this class loads up templates from the file system, it should only be created once per instance of your application.
        /// </summary>
        /// <param name="templatePath">The path to load the Razor templates from.  e.g. @"email\templates".  The template's Build Action should be set to Content and the Copy to Output Directory flag set to Copy Always</param>
        /// <param name="fromEmail">The address the email is from. e.g. [email protected]</param>
        /// <param name="fromName">The name the email is from. e.g. Your Site</param>
        /// <param name="dispatcher">The method by which to send the email.  Custom dispatchers can be implemented using the IEmailDispatcher interface</param>
        public RazorMailerEngine(string templatePath, string fromEmail, string fromName, IEmailDispatcher dispatcher)
        {
            _fromName   = fromName;
            _fromEmail  = fromEmail;
            _dispatcher = dispatcher;

            // Find templates in a web application
            var webPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "bin", templatePath);
            // Find templates from a unit test or console application
            var libraryPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, templatePath);

            var config = new TemplateServiceConfiguration
            {
                TemplateManager = new ResolvePathTemplateManager(new[] { webPath, libraryPath })
            };

            _service = RazorEngineService.Create(config);
        }
 public EmailDispatcher(IEmailDispatcher dispatcher)
 {
     Debug.Assert(dispatcher != null, "The dispatcher should not be null, check configuration or DI.");
     Console.WriteLine("EmailDispatcher constructor initialization");
     this._dispatcher = dispatcher;
 }
 /// <summary>
 /// This overload allows us to pass in a mock dispatcher for testing purposes
 /// </summary>
 public AlarmesEquipamentosMailer(IEmailDispatcher dispatcher)
 {
     // Default to the built in Smtp engine
     _mailerEngine = new RazorMailerEngine(@"email\templates", "*****@*****.**", "Alarmes e Equipamentos", dispatcher);
 }
Exemple #21
0
 public AccountService(NutrientUserManager userManager, NutrientSignInManager signInManager, IEmailDispatcher emailDispatcher, IDomainNotificationHandler domainNotificationHandler, IIntegrationServiceBus integrationBus, ILogger <AccountService> logger)
     : base(userManager, domainNotificationHandler, integrationBus, logger)
 {
     _signInManager   = signInManager;
     _emailDispatcher = emailDispatcher;
 }
Exemple #22
0
 public CustomerCheckedOutHandle(IEmailGenerator emailGenerator, IEmailDispatcher emailSender)
 {
     this.emailDispatcher = emailSender;
     this.emailGenerator  = emailGenerator;
 }
Exemple #23
0
 public SendAccessRequestStrategy(IEmailDispatcher emailDispatcher, ILogService logger, IXmlGenerator xmlGenerator)
 {
     _emailDispatcher = emailDispatcher;
     _logger          = logger;
     _xmlGenerator    = xmlGenerator;
 }
Exemple #24
0
 public CustomerCreatedHandle(INewsletterSubscriber newsletterSubscriber, IEmailDispatcher emailDispatcher)
 {
     this.newsletterSubscriber = newsletterSubscriber;
     this.emailDispatcher      = emailDispatcher;
 }
 public EmailRequestSubscriber(IEmailDispatcher dispatcher, ILogService logService)
 {
     _dispatcher = dispatcher;
     _logService = logService;
 }
 public CommunciationService(IEmailDispatcher emailDispatcher)
 {
     _emailDispatcher = emailDispatcher;
 }
Exemple #27
0
 /// <summary>
 /// This overload allows us to pass in a mock dispatcher for testing purposes
 /// </summary>
 public Mailer(IEmailDispatcher dispatcher)
 {
     // Default to the built in Smtp engine
     _mailerEngine = new RazorMailerEngine(@"email\templates", "*****@*****.**", "Sample Website", dispatcher);
 }
 public CompanyIntegrationEventHandler(ICompanyRepository repository, IUnitOfWork <ILedgerCompanyDbAbstraction> unitOfWork, IEmailDispatcher emailDispatcher)
 {
     _repository      = repository;
     _unitOfWork      = unitOfWork;
     _emailDispatcher = emailDispatcher;
 }
 public UserDomainEventHandler(IEmailDispatcher emailDispatcher, LedgerUserManager userManager)
 {
     _emailDispatcher = emailDispatcher;
     _userManager     = userManager;
 }
Exemple #30
0
 public SendEmployerEnquiryStrategy(IEmailDispatcher emailDispatcher, ILogService logger, IXmlGenerator xmlGenerator)
 {
     _emailDispatcher = emailDispatcher;
     _logger          = logger;
     _xmlGenerator    = xmlGenerator;
 }
Exemple #31
0
 public EmailRequestConsumerAsync(IEmailDispatcher dispatcher)
 {
     _dispatcher = dispatcher;
 }