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