public EmailClientAggregate(IEmailMessageRepository emailRepository, IAtachmentRepository atachmentRepository, IEmailClientFactory emailFactory) { _emailRepository = emailRepository; _atachmentRepository = atachmentRepository; _emailFactory = emailFactory; }
private static HtmlEmailMessageSender GetEmailSender(UserConnection userConnection) { ConstructorArgument userConnectionArg = new ConstructorArgument("userConnection", userConnection); IEmailClientFactory emailClientFactory = ClassFactory.Get <EmailClientFactory>(userConnectionArg); HtmlEmailMessageSender sender = new HtmlEmailMessageSender(emailClientFactory, userConnection); return(sender); }
public ClientTestEmail(IEmailClientFactory emailClientFactory, IMailSignatureHelper mailSignatureHelper, IPath path, IDirectory directory, IFile file) { _emailClientFactory = emailClientFactory; _mailSignatureHelper = mailSignatureHelper; _path = path; _directory = directory; _file = file; }
public EmailClientAggregate(IEmailMessageRepository emailMessageRepository, ISendedEmailMessageRepository sendedEmailMessageRepository, IEmailClientFactory emailClientFactory, IEmailAccountRepository emailAccountRepository) { _emailMessageRepository = emailMessageRepository; _sendedEmailMessageRepository = sendedEmailMessageRepository; _emailAccountRepository = emailAccountRepository; _emailClientFactory = emailClientFactory; }
public void EmailClientAction_NoClientInstalled_ReturnsActionresultWithId101() { _emailClientFactory = MockRepository.GenerateStub <IEmailClientFactory>(); _emailClientFactory.Stub(x => x.CreateEmailClient()).Return(null); var action = new EMailClientAction(_emailClientFactory, SignatureText); var result = action.ProcessJob(_job); Assert.AreEqual(11101, result[0]); }
public void EmailClientAction_NoClientInstalled_ReturnsActionresultWithId101() { _emailClientFactory = Substitute.For <IEmailClientFactory>(); _emailClientFactory.CreateEmailClient().Returns(x => null); var action = BuildAction(); var result = action.ProcessJob(_job); Assert.AreEqual(ErrorCode.MailClient_NoCompatibleEmailClientInstalled, result[0]); }
public SendedEmailMessageService( ISendedEmailMessageRepository sendedEmailMessageRepository, IEmailAccountRepository emailAccountRepository, IEmailClientFactory emailClientFactory, IEmailClientAggregate emailClientAggregate, IMapper mapper) { _sendedEmailMessageRepository = sendedEmailMessageRepository; _emailAccountRepository = emailAccountRepository; _emailClientFactory = emailClientFactory; _emailClientAggregate = emailClientAggregate; _mapper = mapper; }
public void Setup() { _pathWrap = Substitute.For <IPath>(); _directoryWrap = Substitute.For <IDirectory>(); _fileWrap = Substitute.For <IFile>(); _emailClient = Substitute.For <IEmailClient>(); _emailClientFactory = Substitute.For <IEmailClientFactory>(); _emailClientFactory.CreateEmailClient().Returns(_emailClient); _mailSignatureHelper = Substitute.For <IMailSignatureHelper>(); _clientTestEmail = new ClientTestEmail(_emailClientFactory, _mailSignatureHelper, _pathWrap, _directoryWrap, _fileWrap); _emailClientSettings = new EmailClientSettings(); }
public void SetUp() { _tokenReplacer = new TokenReplacer(); _profile = new ConversionProfile(); _profile.EmailClient.Enabled = true; _profile.EmailClient.Subject = "testsubject"; _profile.EmailClient.Content = "This is content\r\nwith line breaks"; _profile.EmailClient.AddSignature = false; _profile.EmailClient.Recipients = "test@local"; _job = MockRepository.GenerateStub <IJob>(); _job.TokenReplacer = _tokenReplacer; _job.OutputFiles = new[] { @"C:\Temp\file1.pdf" }.ToList(); _job.Profile = _profile; _mockMailClient = new MockMailClient(); _emailClientFactory = MockRepository.GenerateStub <IEmailClientFactory>(); _emailClientFactory.Stub(x => x.CreateEmailClient()).Return(_mockMailClient); }
public virtual void SendEmailWithDefaultSender(EmailMessage emailMessage) { ConstructorArgument userConnectionArg = new ConstructorArgument("userConnection", UserConnection); IEmailClientFactory emailClientFactory = ClassFactory.Get <EmailClientFactory>(userConnectionArg); if (UserConnection.GetIsFeatureEnabled("EmailIntegrationV2")) { try { var sender = new ActivityEmailSender(emailClientFactory, UserConnection); sender.Send(emailMessage, true); } catch { if (!IsIgnoreErrors) { throw; } } } else { var credentials = new Terrasoft.Mail.MailCredentials { Host = (string)Core.Configuration.SysSettings.GetValue(UserConnection, "SmtpHost"), Port = int.Parse(Core.Configuration.SysSettings.GetValue(UserConnection, "SmtpPort").ToString()), UseSsl = (bool)Core.Configuration.SysSettings.GetValue(UserConnection, "SmtpEnableSsl"), UserName = (string)Core.Configuration.SysSettings.GetValue(UserConnection, "SmtpUserName"), UserPassword = (string)Core.Configuration.SysSettings.GetValue(UserConnection, "SmtpUserPassword") }; try { var emailClientFactoryArg = new ConstructorArgument("emailClientFactory", emailClientFactory); var emailSener = ClassFactory.Get <IEmailSender>(emailClientFactoryArg, userConnectionArg); emailSener.Send(emailMessage, credentials); } catch { if (!IsIgnoreErrors) { throw; } } } }
public EmailManager(IEmailClientFactory emailFactory) { _emailFactory = emailFactory; _allEmails = new List <EmailModel>(); _unseenEmails = new List <EmailModel>(); }
public EMailClientAction(IEmailClientFactory emailClientFactory, IMailSignatureHelper mailSignatureHelper, IFile file, IMailHelper mailHelper) { _emailClientFactory = emailClientFactory; _file = file; _mailHelper = mailHelper; }
public EMailClientAction(IEmailClientFactory emailClientFactory, string signatureText) { _emailClientFactory = emailClientFactory; _signatureText = signatureText; }
public EMailClientAction(IEmailClientFactory emailClientFactory, IMailSignatureHelper mailSignatureHelper) { _emailClientFactory = emailClientFactory; _mailSignatureHelper = mailSignatureHelper; }
public EMailClientAction(IEmailClientFactory emailClientFactory) { _emailClientFactory = emailClientFactory; }
public IncomingEmailService(IEmailClientFactory clientFactory) { _clientFactory = clientFactory; }
/// <summary><see cref="EmailSender"/> ctor.</summary> /// <param name="emailClientFactory">An instance of the mail client factory.</param> /// <param name="userConnection">An instance of the user connection.</param> public EmailSender(IEmailClientFactory emailClientFactory, UserConnection userConnection) { _emailClientFactory = emailClientFactory; _userConnection = userConnection; }
/// <summary><see cref="ActivityEmailSender"/> ctor.</summary> /// <param name="emailClientFactory">An instance of the mail client factory.</param> /// <param name="userConnection">An instance of the user connection.</param> public ActivityEmailSender(IEmailClientFactory emailClientFactory, UserConnection userConnection) : base(emailClientFactory, userConnection) { }
/// <summary>Initialize new instance of the <see cref="HtmlEmailMessageSender"/> class.</summary> /// <param name="emailClientFactory">EmailClient factory instance.</param> /// <param name="userConnection">User connection instance.</param> public HtmlEmailMessageSender(IEmailClientFactory emailClientFactory, UserConnection userConnection) : base(emailClientFactory, userConnection) { }
/// <summary>Initialize new instance of the <see cref="SecureActivityEmailSender"/> class.</summary> /// <param name="emailClientFactory">EmailClient factory instance.</param> /// <param name="userConnection">User connection instance.</param> public SecureActivityEmailSender(IEmailClientFactory emailClientFactory, UserConnection userConnection) : base(emailClientFactory, userConnection) { SecurityTokenUtilities = new SecurityTokenUtilities(userConnection); }