public JsonResult NotificationTemplate(NotificationTemplateSetupModel model) { if (ModelState.IsValid) { return(Json(_notificationService.SaveNotificationTemplate(model))); } return(Json(new ResponseModel { Success = false, Message = ModelState.BuildValidationMessages() })); }
/// <summary> /// Save notification template to notification /// </summary> /// <param name="model"></param> /// <returns></returns> public ResponseModel SaveNotificationTemplate(NotificationTemplateSetupModel model) { var notification = GetById(model.Id); if (notification != null) { notification.NotificationSubject = model.NotificationSubject; notification.NotificationBody = model.NotificationBody; var response = Update(notification); return(response.Success ? response.SetMessage(T("Notification_Message_SavingNotificationTemplateSuccessfully")) : response.SetMessage(T("Notification_Message_SavingNotificationTemplateFailure"))); } return(new ResponseModel { Success = false, Message = T("Notification_Message_ObjectNotFound") }); }