(window.webpackJsonp=window.webpackJsonp||[]).push([[379],{ewtx:function(t,e,s){"use strict";s.r(e);var a={components:{},data:function(){return{id:this.$route.params.id,templateForm:new Form({help_topic:"",body:""}),fields:""}},mounted:function(){helper.hasPermission("access-configuration")||(helper.notAccessibleMsg(),this.$router.push("/dashboard")),helper.featureAvailable("email_template")||(helper.featureNotAvailableMsg(),this.$router.push("/dashboard")),this.getPreRequisite()},methods:{getPreRequisite:function(){var t=this,e=this.$loading.show();axios.get("/api/email-template/"+this.id).then((function(s){t.templateForm.subject=s.email_template.subject,t.templateForm.body=s.email_template.body,t.fields=s.fields,e.hide()})).catch((function(s){e.hide(),helper.showErrorMsg(s),t.$router.push("/utility/email-template")}))},submit:function(){var t=this,e=this.$loading.show();this.templateForm.patch("/api/email-template/"+this.id).then((function(s){toastr.success(s.message),e.hide(),t.$router.push("/utility/email-template")})).catch((function(t){e.hide(),helper.showErrorMsg(t)}))}}},i=s("KHd+"),r=Object(i.a)(a,(function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",[s("div",{staticClass:"page-titles"},[s("div",{staticClass:"row"},[s("div",{staticClass:"col-12 col-sm-6"},[s("h3",{staticClass:"text-themecolor"},[t._v(t._s(t.trans("utility.edit_email_template")))])]),t._v(" "),s("div",{staticClass:"col-12 col-sm-6"},[s("div",{staticClass:"action-buttons pull-right"},[s("button",{staticClass:"btn btn-info btn-sm",on:{click:function(e){return t.$router.push("/email-template")}}},[s("i",{staticClass:"far fa-envelope"}),t._v(" "),s("span",{staticClass:"d-none d-sm-inline"},[t._v(t._s(t.trans("utility.email_template")))])])])])])]),t._v(" "),s("div",{staticClass:"container-fluid"},[s("div",{staticClass:"card card-form"},[s("div",{staticClass:"card-body"},[s("form",{on:{submit:function(e){return e.preventDefault(),t.submit(e)},keydown:function(e){return t.templateForm.errors.clear(e.target.name)}}},[s("div",{staticClass:"form-group"},[s("label",{attrs:{for:""}},[t._v(t._s(t.trans("utility.email_template_subject")))]),t._v(" "),s("input",{directives:[{name:"model",rawName:"v-model",value:t.templateForm.subject,expression:"templateForm.subject"}],staticClass:"form-control",attrs:{type:"text",name:"subject",placeholder:t.trans("utility.email_template_subject")},domProps:{value:t.templateForm.subject},on:{input:function(e){e.target.composing||t.$set(t.templateForm,"subject",e.target.value)}}}),t._v(" "),s("show-error",{attrs:{"form-name":t.templateForm,"prop-name":"subject"}})],1),t._v(" "),s("div",{staticClass:"form-group"},[s("html-editor",{attrs:{name:"body",model:t.templateForm.body,isUpdate:"true"},on:{"update:model":function(e){return t.$set(t.templateForm,"body",e)},clearErrors:function(e){return t.templateForm.errors.clear("body")}}}),t._v(" "),s("show-error",{attrs:{"form-name":t.templateForm,"prop-name":"body"}})],1),t._v(" "),s("div",{staticClass:"help-block"},[t._v(t._s(t.trans("utility.available_fields"))+": "+t._s(t.fields))]),t._v(" "),s("div",{staticClass:"card-footer text-right"},[s("button",{staticClass:"btn btn-info waves-effect waves-light pull-right m-t-10",attrs:{type:"submit"}},[t._v(t._s(t.trans("general.save")))]),t._v(" "),s("button",{staticClass:"btn btn-danger waves-effect waves-light pull-right m-t-10 ",attrs:{type:"button"},on:{click:function(e){return t.$router.push("/utility/email-template")}}},[t._v(t._s(t.trans("general.cancel")))])])])])])])])}),[],!1,null,null,null);e.default=r.exports}}]);
//# sourceMappingURL=edit.js.map?id=438eefc4b465298ea5fc