Example #1
0
        public ActionResult Edit(EmailTemplateEditModel model)
        {
            if (!ModelState.IsValid)
            {
                return(View(_emailTemplateService.CompleteModel(model)));
            }

            try
            {
                model = _emailTemplateService.Save(model, _sessionContext.UserSession.CurrentOrganizationRole.OrganizationRoleUserId);
                model.FeedbackMessage = FeedbackMessageModel.CreateSuccessMessage("Template updated successfully!");
            }
            catch (Exception ex)
            {
                model = _emailTemplateService.CompleteModel(model);
                model.FeedbackMessage = FeedbackMessageModel.CreateFailureMessage(string.Concat("System Failure! Message: ", ex.Message));
            }

            return(View(model));
        }