Liferay.Loader.define("dynamic-data-mapping-form-web@4.0.150/admin/js/util/submitEmailContent.es",["module","exports","require","data-engine-js-components-web","frontend-js-web"],(function(e,s,t){window;{Object.defineProperty(s,"__esModule",{value:!0}),s.submitEmailContent=function submitEmailContent({addresses:e,message:s,portletNamespace:t,shareFormInstanceURL:n,subject:o}){if(!e||!e.length)return;const r={["".concat(t,"addresses")]:e.map((({label:e})=>e)).join(","),["".concat(t,"message")]:s,["".concat(t,"subject")]:o};(0,a.makeFetch)({body:(0,a.convertToFormData)(r),method:"POST",url:n}).then((e=>e.successMessage?openNotification({message:e.successMessage}):openNotification({error:!0,message:e.errorMessage}))).catch((e=>{throw new Error(e)}))};var a=t("data-engine-js-components-web"),n=t("frontend-js-web");const openNotification=({error:e,message:s})=>{const t={message:s};e?(t.title=Liferay.Language.get("error"),t.type="danger"):t.title=Liferay.Language.get("success"),(0,n.openToast)(t)}}}));
//# sourceMappingURL=submitEmailContent.es.js.map