public virtual ActionResult EditReply(ContactUsSendReplyViewModel model)
        {
            // Convert <br /> tags into newlines, to make editing easier
            model.EmailContent = model.EmailContent
                                 .Replace("<br />", Environment.NewLine)
                                 .Replace("<br>", Environment.NewLine);

            return(View(MVC.FillPerfect.FpContactResponse.Views.SendReply, model));
        }
        public virtual ActionResult SendReplyConfirm(ContactUsSendReplyViewModel model)
        {
            // Convert newlines into <br /> tags
            model.EmailContent = model.EmailContent.Replace(Environment.NewLine, "<br />");

            // Send the reply
            _sendFpReplyProc.Execute(new SendFpReplyParams
            {
                RequestingUserId = CurrentUserId,
                ResponseId       = model.ResponseId,
                FromAddress      = model.FromAddress,
                ToAddress        = model.ToEmail,
                Subject          = model.EmailSubject,
                EmailContent     = model.EmailContent
            });
            return(RedirectToAction(MVC.FillPerfect.FpContactResponse.ReplySent(model.ToName)));
        }
        public virtual ActionResult SendReply(ContactUsSendReplyViewModel model)
        {
            // Perform validation
            if (string.IsNullOrWhiteSpace(model.EmailSubject))
            {
                ModelState.AddModelError("EmailSubject", "Email subject cannot be empty");
            }

            if (!ModelState.IsValid)
            {
                return(View(model));
            }

            // Convert newlines into <br /> tags
            model.EmailContent = model.EmailContent.Replace(Environment.NewLine, "<br />");

            // Show confirmation view
            return(View(MVC.FillPerfect.FpContactResponse.Views.SendReplyConfirm, model));
        }
        public virtual ActionResult SendReply(string toName, string toEmail, string password, string orgName, int responseId, string emailContent = "")
        {
            // Get the email for the current user
            var email = _context.Users
                        .Where(x => x.Id == CurrentUserId)
                        .Select(x => x.Email)
                        .Single();

            var model = new ContactUsSendReplyViewModel
            {
                ResponseId   = responseId,
                ToName       = toName,
                ToEmail      = toEmail,
                ToOrgName    = orgName,
                ToPassword   = password,
                EmailContent = emailContent,
                FromAddress  = email
            };

            return(View(model));
        }