Exemple #1
0
        public virtual MvcMailMessage Contact(ContactFormViewModel contactFormViewModel)
        {
            var emailViewModel =
                _emailContentService.GetEmailViewModelFromGeneralEmail(ConfigurationParameters.AppSettings.EmailContact);

            emailViewModel.Name = contactFormViewModel.Name;

            MasterName = ViewNames.Views.Email.MasterEmail;
            ViewData   = new ViewDataDictionary(emailViewModel);
            return(Populate(x =>
            {
                x.Subject = emailViewModel.Subject;
                x.ViewName = ViewNames.Views.Email.Contact;
                x.To.Add(emailViewModel.ToAddresses.First());
                x.From = new MailAddress(contactFormViewModel.Email, contactFormViewModel.Name);
            }));
        }