예제 #1
0
        public ActionResult EmailTemplateEdit(EmailTemplateEditViewModel emailTemplateEditViewModel)
        {
            GRINGlobalService grinGlobalService = new GRINGlobalService(this.AuthenticatedUserSession.Environment);
            EmailTemplate     emailTemplate     = new EmailTemplate();
            ResultContainer   resultContainer   = new ResultContainer();

            try
            {
                emailTemplate.ID      = emailTemplateEditViewModel.ID;
                emailTemplate.Title   = emailTemplateEditViewModel.Title;
                emailTemplate.Subject = emailTemplateEditViewModel.Subject;
                emailTemplate.From    = emailTemplateEditViewModel.SenderAddress;
                emailTemplate.To      = emailTemplateEditViewModel.RecipientAddress;
                emailTemplate.Body    = emailTemplateEditViewModel.Body;
                resultContainer       = grinGlobalService.UpdateEmailTemplate(emailTemplate);
                return(RedirectToAction("EmailTemplateEdit", "WebOrder", new { id = emailTemplateEditViewModel.ID }));
            }
            catch (Exception ex)
            {
                Log.Error(ex, ex.Message);
                return(RedirectToAction("InternalServerError", "Error"));
            }
        }