diff --git a/client/src/components/email-overlay/email-overlay.container.jsx b/client/src/components/email-overlay/email-overlay.container.jsx index 675e14b3e..d5d1a17ae 100644 --- a/client/src/components/email-overlay/email-overlay.container.jsx +++ b/client/src/components/email-overlay/email-overlay.container.jsx @@ -36,6 +36,7 @@ export function EmailOverlayContainer({ const [loading, setLoading] = useState(false); const [sending, setSending] = useState(false); + const [rawHtml, setRawHtml] = useState(""); const defaultEmailFrom = { from: { name: bodyshop.shopname || EmailSettings.fromNameDefault, @@ -65,7 +66,11 @@ export function EmailOverlayContainer({ setSending(true); try { - await axios.post("/sendemail", { ...messageOptions, attachments }); + await axios.post("/sendemail", { + ...messageOptions, + html: rawHtml, + attachments, + }); notification["success"]({ message: t("emails.successes.sent") }); toggleEmailOverlayVisible(); } catch (error) { @@ -115,6 +120,7 @@ export function EmailOverlayContainer({ html: html, url: `${window.location.protocol}://${window.location.host}/`, }); + setRawHtml(response.data); console.log("response", response); setMessageOptions({ diff --git a/client/src/components/labor-allocations-adjustment-edit/labor-allocations-adjustment-edit.component.jsx b/client/src/components/labor-allocations-adjustment-edit/labor-allocations-adjustment-edit.component.jsx index 3281474e9..e593b67b4 100644 --- a/client/src/components/labor-allocations-adjustment-edit/labor-allocations-adjustment-edit.component.jsx +++ b/client/src/components/labor-allocations-adjustment-edit/labor-allocations-adjustment-edit.component.jsx @@ -61,7 +61,7 @@ export default function LaborAllocationsAdjustmentEdit({ onFinish={handleFinish} initialValues={{ mod_lbr_ty: mod_lbr_ty, - hours: adjustments[mod_lbr_ty], + hours: adjustments && adjustments[mod_lbr_ty], }} >