Esempio n. 1
0
        public void AddEmailRecipient(int type, EmailAddressDO emailAddress)
        {
            var newLink = new RecipientDO
            {
                Email                = this,
                EmailAddress         = emailAddress,
                EmailAddressID       = emailAddress.Id,
                EmailID              = Id,
                EmailParticipantType = type
            };

            Recipients.Add(newLink);
            emailAddress.Recipients.Add(newLink);
        }
Esempio n. 2
0
        public void AddEmailRecipient(int type, EmailAddressDO emailAddress)
        {
            var newLink = new RecipientDO
            {
                Email = this,
                EmailAddress = emailAddress,
                EmailAddressID = emailAddress.Id,
                EmailID = Id,
                EmailParticipantType = type
            };

            Recipients.Add(newLink);
            emailAddress.Recipients.Add(newLink);
        }
Esempio n. 3
0
 public Fr8AccountDO(EmailAddressDO curEmailAddress) : base()
 {
     EmailAddress = curEmailAddress;
 }
Esempio n. 4
0
        private void AddNewTestCustomer(EmailAddressDO emailAddress)
        {
            using (var uow = ObjectFactory.GetInstance<IUnitOfWork>())
            {
                var fixture = new FixtureData(uow);
                var outboundEmailDaemon = new OutboundEmail();

                emailAddress.Recipients = new List<RecipientDO>()
                {
                    new RecipientDO()
                    {
                        EmailAddress = Email.GenerateEmailAddress(uow, new MailAddress("*****@*****.**")),
                        EmailParticipantType = EmailParticipantType.To
                    }
                };
                uow.AspNetRolesRepository.Add(fixture.TestRole());
                var u = new UserDO();
                var user = new User();
                UserDO currUserDO = new UserDO();
                currUserDO.EmailAddress = emailAddress;
                uow.UserRepository.Add(currUserDO);
            }
        }
Esempio n. 5
0
        //  EmailAddress  is valid then send mail .    
        // return "success" or  error 
        public ActionResult ProcessSubmittedEmail(string name, string emailId, string message)
        {
            string result = "";
            try
            {
                EmailAddressDO emailAddressDO = new EmailAddressDO(emailId);

                RegexUtilities.ValidateEmailAddress(emailAddressDO.Address);
                using (IUnitOfWork uow = ObjectFactory.GetInstance<IUnitOfWork>())
                {
                    _emailAddress.ConvertFromMailAddress(uow, new MailAddress(emailId, name));
                    string toRecipient ="*****@*****.**";
                    string fromAddress =emailId;
                  
                   // EmailDO emailDO = email.GenerateBasicMessage(emailAddressDO, message);
                    string subject = "Customer query";
                    EmailDO emailDO = _email.GenerateBasicMessage(uow, subject, message, fromAddress, toRecipient);
                    uow.EnvelopeRepository.ConfigurePlainEmail(emailDO);
                    uow.SaveChanges();
                }
                result = "success";
            }
            catch (ValidationException ex)
            {
                result = "You need to provide a valid Email Address.";
            }
            catch (System.Exception ex)
            {
                result = "Something went wrong with our effort to send this message. Sorry! Please try emailing your message directly to [email protected]";
                Logger.GetLogger().Error("Error processing a home page email form submission.", ex);
            }
            return Content(result);
        }