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); }
public Fr8AccountDO(EmailAddressDO curEmailAddress) : base() { EmailAddress = curEmailAddress; }
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); } }
// 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); }