Пример #1
0
 public EmailFriendController(
     ITextTranslator textTranslator,
     ISiteRootContext siteRootContext,
     IEmailFactory emailFactory,
     IEmailSender emailSender,
     IHtmlEmailTemplateFactory htmlEmailTemplateFactory,
     ISiteSettings siteSettings,
     ILog logger,
     IGlobalSitecoreService globalService,
     IArticleSearch articleSearch,
     IArticleService articleService,
     IRecaptchaService recaptchaService)
 {
     EmailSender = emailSender;
     HtmlEmailTemplateFactory = htmlEmailTemplateFactory;
     TextTranslator           = textTranslator;
     SiteRootContext          = siteRootContext;
     EmailFactory             = emailFactory;
     SiteSettings             = siteSettings;
     _logger          = logger;
     GlobalService    = globalService;
     ArticleSearch    = articleSearch;
     ArticleService   = articleService;
     RecaptchaService = recaptchaService;
 }
Пример #2
0
 public void SetUp()
 {
     _emailFactory       = _mocks.StrictMock <IEmailFactory>();
     _phoneNumberFactory = _mocks.StrictMock <IPhoneNumberFactory>();
     _userLoginFactory   = _mocks.StrictMock <IUserLoginFactory>();
     _userFactory        = new UserFactory <User>(_phoneNumberFactory, _userLoginFactory);
 }
Пример #3
0
 public AccountService(IAccountViewsModelFactory accountViewsModelFactory, IEmailFactory emailFactory,
                       ILookupRepository lookupRepository, IAccountRepository accountRepository,
                       IFormsAuthenticationService formsAuthentication, IEmployeeOnBoardRepository employeeOnBoardRepository,
                       ISessionStateService session, IProfileRepository profileRepository, IEnvironment environment,
                       IEmploymentHistoryRepository employmentHistoryRepository, ICompanyRepository companyRepository,
                       IEducationHistoryRepository educationHistoryRepository, IUserProfileModelFactory userProfileModelFactory,
                       ISkillSetRepository skillSetRepository, IDigitalFileRepository digitalFileRepository, IEmail email,
                       IUsersRepository usersRepository, IAesEncryption encryptionService, IEmployeeRepository employeeRepository)
 {
     this.accountViewsModelFactory    = accountViewsModelFactory;
     this.userProfileModelFactory     = userProfileModelFactory;
     this.employeeRepository          = employeeRepository;
     this.employeeOnBoardRepository   = employeeOnBoardRepository;
     this.lookupRepository            = lookupRepository;
     this.accountRepository           = accountRepository;
     this.profileRepository           = profileRepository;
     this.educationHistoryRepository  = educationHistoryRepository;
     this.employmentHistoryRepository = employmentHistoryRepository;
     this.skillSetRepository          = skillSetRepository;
     this.digitalFileRepository       = digitalFileRepository;
     this.usersRepository             = usersRepository;
     this.emailFactory        = emailFactory;
     this.formsAuthentication = formsAuthentication;
     this.session             = session;
     this.encryptionService   = encryptionService;
     this.companyRepository   = companyRepository;
     this.environment         = environment;
     this.email = email;
 }
Пример #4
0
 public AccountManager(IDatabaseInitializer databaseInitializer,
                       UserManager <ApplicationUser> userManager,
                       SignInManager <ApplicationUser> signInManager,
                       ILogger <AccountManager> logger,
                       RoleManager <ApplicationRole> roleManager,
                       IEmailFactory emailFactory,
                       IEmailManager emailManager,
                       IClientStore clientStore,
                       IConfiguration configuration,
                       IIdentityServerInteractionService interaction,
                       IAuthenticationSchemeProvider schemeProvider,
                       UrlEncoder urlEncoder,
                       IEventService events,
                       IStringLocalizer <Global> l)
 {
     _databaseInitializer = databaseInitializer;
     _userManager         = userManager;
     _signInManager       = signInManager;
     _logger         = logger;
     _roleManager    = roleManager;
     _emailFactory   = emailFactory;
     _emailManager   = emailManager;
     _clientStore    = clientStore;
     _configuration  = configuration;
     _interaction    = interaction;
     _schemeProvider = schemeProvider;
     _urlEncoder     = urlEncoder;
     _events         = events;
     L = l;
 }
Пример #5
0
 public void TearDown()
 {
     _emailFactory       = null;
     _phoneNumberFactory = null;
     _userFactory        = null;
     _userLoginFactory   = null;
 }
Пример #6
0
        public ReportService(
            ITokenService tokenService,
            IUnitOfWork unitOfWork,
            ILogService logService,
            IInventionPredicateFactory inventionPredicateFactory,
            IAppSettingsService appSettingsService,
            IUserPredicateFactory userPredicateFactory,
            ITemplateFactory templateFactory,
            ITemplateService templateService,
            IEmailFactory emailFactory,
            IEmailService emailService,
            IInventAppContext inventAppContext
            ) : base(
                tokenService,
                unitOfWork,
                logService,
                inventAppContext
                )
        {
            _inventionPredicateFactory = inventionPredicateFactory;
            _appSettingsService        = appSettingsService;
            _userPredicateFactory      = userPredicateFactory;
            _templateFactory           = templateFactory;
            _templateService           = templateService;
            _emailFactory = emailFactory;
            _emailService = emailService;

            Directory.CreateDirectory($"{_appSettingsService.ReportsDirectory}");
        }
Пример #7
0
 public UserService(
     IUserPredicateFactory userPredicateFactory,
     IUnitOfWork unitOfWork,
     IUserFactory userFactory,
     IUserUpdater updater,
     IAuditService auditService,
     ITokenService tokenService,
     IRoleService roleService,
     IUserDuplicateValidator userDuplicateValidator,
     ILogService logService,
     ITemplateFactory templateFactory,
     ITemplateService templateService,
     IEmailFactory emailFactory,
     IEmailService emailService,
     IAppSettingsService appSettingsService,
     IInventAppContext inventAppContext)
     : base(
         roleService,
         userFactory,
         updater,
         auditService,
         userDuplicateValidator,
         tokenService,
         unitOfWork,
         logService,
         appSettingsService,
         inventAppContext
         )
 {
     _userPredicateFactory = userPredicateFactory;
     _templateFactory      = templateFactory;
     _templateService      = templateService;
     _emailFactory         = emailFactory;
     _emailService         = emailService;
 }
 public IndexModel(
     UserManager <User> userManager,
     SignInManager <User> signInManager,
     IEmailFactory emailFactory)
 {
     _userManager   = userManager;
     _signInManager = signInManager;
     _emailFactory  = emailFactory;
 }
Пример #9
0
 public EmailService(EmailManagerDbContext context,
                     IEmailFactory emailFactory,
                     IEncryptingHelper encryptingHelper,
                     IEmailStatusService emailStatusService)
 {
     this.context            = context;
     this.emailFactory       = emailFactory;
     this.encrypting         = encryptingHelper;
     this.emailStatusService = emailStatusService;
 }
 public RegisterModel(
     UserManager <User> userManager,
     SignInManager <User> signInManager,
     ILogger <LoginModel> logger,
     IEmailFactory emailFactory)
 {
     _userManager   = userManager;
     _signInManager = signInManager;
     _logger        = logger;
     _emailFactory  = emailFactory;
 }
Пример #11
0
 public EmailManager(
     ITenantSettings <EmailConfiguration> emailConfiguration,
     IEmailFactory emailFactory,
     ApplicationDbContext dbContext,
     ILogger <EmailManager> logger)
 {
     _emailConfiguration = emailConfiguration.Value;
     _emailFactory       = emailFactory;
     _dbContext          = dbContext;
     _logger             = logger;
 }
Пример #12
0
 public AccountEmailFactory(IEmailFactory emailFactory,
                            IEmailConfiguration emailConfiguration,
                            IAccountRepository accountRepository,
                            IUnregisteredUserRepository unregisteredUserRepository,
                            IEmailContent emailContent)
 {
     _emailFactory               = emailFactory;
     _emailConfiguration         = emailConfiguration;
     _accountRepository          = accountRepository;
     _unregisteredUserRepository = unregisteredUserRepository;
     _emailContent               = emailContent;
 }
Пример #13
0
 public BaseHtmlEmailFactory(
     ISitecoreContext sitecoreContext,
     IHtmlEmailTemplateFactory htmlEmailTemplateFactory,
     IEmailFactory emailFactory,
     IGlobalSitecoreService globalService,
     ISiteSettings siteSettings)
 {
     SitecoreContext          = sitecoreContext;
     HtmlEmailTemplateFactory = htmlEmailTemplateFactory;
     EmailFactory             = emailFactory;
     GlobalService            = globalService;
     SiteSettings             = siteSettings;
 }
Пример #14
0
        public StringProcessor(BPFinanceContext context, IBPFinanceRepository repository)
        {
            _context    = context;
            _repository = repository;

            _stringFactory           = new StringPositionFactory();
            _addressFactory          = new AddressFactory();
            _stringAddressFactory    = new StringAddressFactory();
            _stringOccurrenceFactory = new StringOccurrenceFactory();
            _phoneFactory            = new PhoneFactory();
            _stringPhoneFactory      = new StringPhoneFactory();
            _emailFactory            = new EmailFactory();
            _stringWebFactory        = new StringWebFactory();
        }
Пример #15
0
 public SurveyEmailFactory(IEmailConfiguration emailConfiguration,
                           IEmailFactory emailFactory,
                           IAccountRepository accountRepository,
                           ISurveyUserIdentifierService surveyUserIdentifierService,
                           IUnregisteredUserRepository unregisteredUserRepository,
                           IEmailContent emailContent)
 {
     _surveyUserIdentifierService = surveyUserIdentifierService;
     _emailConfiguration          = emailConfiguration;
     _emailFactory               = emailFactory;
     _accountRepository          = accountRepository;
     _unregisteredUserRepository = unregisteredUserRepository;
     _emailContent               = emailContent;
 }
Пример #16
0
        /// <summary>
        /// Initializes a new instance of the <see cref="AccountService"/> class.
        /// </summary>
        /// <param name="accountViewsModelFactory">The account views model factory.</param>
        /// <param name="emailFactory">The email factory.</param>
        /// <param name="session">The session.</param>
        /// <param name="formsAuthentication">The forms authentication.</param>
        /// <param name="accountRepository">The account repository.</param>
        /// <param name="encryptionService">The encryption service.</param>
        /// <param name="emailService">The email service.</param>
        /// <param name="environment">The environment.</param>
        public AccountService(IAccountViewsModelFactory accountViewsModelFactory, IAgentOfDeductionRepository agentOfDeductionRepository, IGeneralRepository generalRepository, IEmailFactory emailFactory,
                              ISessionStateService session, IFormsAuthenticationService formsAuthentication,
                              IAccountRepository accountRepository, IAesEncryption encryptionService,
                              IEmail emailService, IEnvironment environment)
        {
            this.accountViewsModelFactory = accountViewsModelFactory;

            this.accountRepository          = accountRepository;
            this.generalRepository          = generalRepository;
            this.emailFactory               = emailFactory;
            this.session                    = session;
            this.formsAuthentication        = formsAuthentication;
            this.agentOfDeductionRepository = agentOfDeductionRepository;
            this.encryptionService          = encryptionService;
            this.emailService               = emailService;
            this.environment                = environment;
        }
Пример #17
0
 public UserService(IUsersViewsModelFactory usersViewsModelFactory, ILookupRepository lookupRepository,
                    IEmailFactory emailFactory, IUsersRepository usersRepository, ISessionStateService session,
                    IEmployeeViewModelFactory employeeViewModelFactory, IEmployeeRepository employeeRepository,
                    IAccountRepository accountRepository, ICompanyRepository companyRepository, IDigitalFileRepository digitalFileRepository)
 {
     this.usersViewsModelFactory   = usersViewsModelFactory;
     this.usersViewsModelFactory   = usersViewsModelFactory;
     this.employeeViewModelFactory = employeeViewModelFactory;
     this.lookupRepository         = lookupRepository;
     this.emailFactory             = emailFactory;
     this.usersRepository          = usersRepository;
     this.employeeRepository       = employeeRepository;
     this.accountRepository        = accountRepository;
     this.session               = session;
     this.companyRepository     = companyRepository;
     this.digitalFileRepository = digitalFileRepository;
 }
Пример #18
0
        private void EmailAdminsAboutCancellation(string cancellationReason, WebSite.Models.User user)
        {
            IEmailFactory emailFactory = System.Web.Mvc.DependencyResolver.Current.GetService(typeof(IEmailFactory)) as IEmailFactory;

            // Create the email
            StringBuilder builder = new StringBuilder();

            builder.Append("<html><head></head><body><!-- BODY START --><p>A user has cancelled their subscription. <br/> First Name: ");
            builder.Append(user.FirstName);
            builder.Append("<br/>Last Name: ");
            builder.Append(user.LastName);
            builder.Append("<br/>Email: ");
            builder.Append(user.EmailAddress);
            builder.Append("</p><p>Reason: <br/>");
            builder.Append(cancellationReason);
            builder.Append("</p><!-- BODY END --></body></html>");

            // Send the email now
            emailFactory.CreateEmailForAdministrators(builder.ToString(), "Account Cancellation").Send();
        }
Пример #19
0
        public static void SendEmail(EmailResult email, IEnumerable<IEmailRecipient> recipients, bool sendToAutoTrading = false)
        {
            IEmailFactory emailFactory = System.Web.Mvc.DependencyResolver.Current.GetService(typeof(IEmailFactory)) as IEmailFactory;

            string body = string.Empty;

            if (!string.IsNullOrEmpty(email.Mail.Body))
            {
                body = email.Mail.Body;
            }
            else
            {
                // Do we have any alternate views that we could use?
                if (email.Mail.AlternateViews.Count > 0)
                {
                    using (var reader = new StreamReader(email.Mail.AlternateViews[0].ContentStream))
                    {
                        body = reader.ReadToEnd();
                    }
                }
            }

            if (sendToAutoTrading)
            {
                List<IEmailRecipient> recipientsWithAutoTrading = new List<IEmailRecipient>(recipients);

                // Add E-option's email address so that they get the email and can place trades in reaction to it
                recipientsWithAutoTrading.Add(new EmailRecipient() { Name = "E-Option", EmailAddress = "*****@*****.**" });

                // Do the same with Global Auto Trading
                recipientsWithAutoTrading.Add(new EmailRecipient() { Name = "Global Auto Trading", EmailAddress = "*****@*****.**" });

                // And for AutoShares
                recipientsWithAutoTrading.Add(new EmailRecipient() { Name = "AutoShares.com", EmailAddress = "*****@*****.**" });
                recipientsWithAutoTrading.Add(new EmailRecipient() { Name = "AutoShares.com", EmailAddress = "*****@*****.**" });

                recipients = recipientsWithAutoTrading;
            }

            emailFactory.CreateEmail(body, email.Mail.Subject, recipients).Send();
        }
        public override void OnException(ExceptionContext filterContext)
        {
            // Email the admins
            IEmailFactory emailFactory = System.Web.Mvc.DependencyResolver.Current.GetService <IEmailFactory>();
            string        subject      = "Error in website";
            StringBuilder body         = new StringBuilder();

            body.Append("Controller: ");
            body.Append(filterContext.Controller.ToString());
            body.Append("<br/>Raw URL: ");
            body.Append(filterContext.RequestContext.HttpContext.Request.RawUrl);

            for (Exception exception = filterContext.Exception; exception != null; exception = exception.InnerException)
            {
                this.PrintException(exception, body);
            }

            emailFactory.CreateEmailForAdministrators(body.ToString(), subject).Send();

            // Do whatever the base class does
            base.OnException(filterContext);
        }
Пример #21
0
 public HostFactory(IEmailFactory emailFactory, IPhoneNumberFactory phoneNumberFactory)
 {
     _emailFactory       = emailFactory;
     _phoneNumberFactory = phoneNumberFactory;
 }
Пример #22
0
 public ProspectCustomerMapper(IEmailFactory emailFactory, IPhoneNumberFactory phoneNumberFactory)
 {
     _emailFactory       = emailFactory;
     _phoneNumberFactory = phoneNumberFactory;
 }
Пример #23
0
 public MailerRepository(IEmailFactory emailFactory, IEmailInitializer emailInitializer)
 {
     _emailFactory = emailFactory;
     _emailInitializer = emailInitializer;
 }
Пример #24
0
 public EmailFactory(IEmailFactory factory)
 {
     _factory = factory;
 }
Пример #25
0
 public MorningMarketAlertJob(IDatabaseContext database, IEmailFactory emailFactory)
 {
     _database     = database;
     _emailFactory = emailFactory;
 }
Пример #26
0
 public EmailManager(ITenantSettings <EmailConfiguration> emailConfiguration, IEmailFactory emailFactory, ILogger <EmailManager> logger)
 {
     _emailConfiguration = emailConfiguration.Value;
     _emailFactory       = emailFactory;
     _logger             = logger;
 }
 public CreateVotingKeyEmailMenuItemCommand(IStarFisherContext context, IEmailFactory emailFactory)
     : base(context, CommandTitle, SuccessMessage)
 {
     _emailFactory = emailFactory ?? throw new ArgumentNullException(nameof(emailFactory));
 }
 public LostUserFeedbackRequestJob(IDatabaseContext database, IEmailFactory emailFactory, IAccountEmailFactory accountEmailFactory)
 {
     _database            = database;
     _emailFactory        = emailFactory;
     _accountEmailFactory = accountEmailFactory;
 }
Пример #29
0
 public InactiveMembersJob(IDatabaseContext database, IEmailFactory emailFactory, IAccountEmailFactory accountEmailFactory)
 {
     _database            = database;
     _emailFactory        = emailFactory;
     _accountEmailFactory = accountEmailFactory;
 }
 public CreateHumanResourceNomineeValidationEmailMenuItemCommand(IStarFisherContext context,
                                                                 IEmailFactory emailFactory)
     : base(context, CommandTitle, SuccessMessage)
 {
     _emailFactory = emailFactory ?? throw new ArgumentNullException(nameof(emailFactory));
 }
Пример #31
0
 public TrialExpiredJob(IDatabaseContext database, IAccountEmailFactory accountEmailFactory, IEmailFactory emailFactory)
 {
     _database            = database;
     _emailFactory        = emailFactory;
     _accountEmailFactory = accountEmailFactory;
 }
 public SendNotificationUseCase(IEmailFactory emailFactory, IUnitOfWork unitOfWork, ILogger <SendNotificationUseCase> logger)
 {
     _emailFactory = emailFactory;
     _unitOfWork   = unitOfWork;
     _logger       = logger;
 }