diff --git a/client/src/components/email-test/email-test-component.jsx b/client/src/components/email-test/email-test-component.jsx index 185587c43..9d1a2ffec 100644 --- a/client/src/components/email-test/email-test-component.jsx +++ b/client/src/components/email-test/email-test-component.jsx @@ -1,10 +1,11 @@ -import { Button, Form, Input } from "antd"; +import { Button, Form, Input, Switch } from "antd"; import React from "react"; import { useTranslation } from "react-i18next"; import { connect } from "react-redux"; import { createStructuredSelector } from "reselect"; import { setEmailOptions } from "../../redux/email/email.actions"; import { selectCurrentUser } from "../../redux/user/user.selectors"; +import { GenerateDocument } from "../../utils/RenderTemplate"; const mapStateToProps = createStructuredSelector({ currentUser: selectCurrentUser, @@ -19,17 +20,16 @@ export function EmailTestComponent({ currentUser, setEmailOptions }) { const handleFinish = (values) => { console.log("values", values); - setEmailOptions({ - messageOptions: { - to: currentUser.email || null, - }, - template: { + GenerateDocument( + { name: values.key, variables: { id: values.id, }, }, - }); + {}, + values.email ? "e" : "p" + ); }; return ( @@ -64,6 +64,13 @@ export function EmailTestComponent({ currentUser, setEmailOptions }) { > + + + diff --git a/client/src/utils/RenderTemplate.js b/client/src/utils/RenderTemplate.js index 6912cad93..a3d1fcc1b 100644 --- a/client/src/utils/RenderTemplate.js +++ b/client/src/utils/RenderTemplate.js @@ -75,15 +75,15 @@ export default async function RenderTemplate( if (!renderAsHtml) { render.download(); - var html = - "" + - "" + - "" + - '' + - ""; - displayTemplateInWindowNoprint(html); + // var html = + // "" + + // "" + + // "" + + // '' + + // ""; + // displayTemplateInWindowNoprint(html); } else { return new Promise((resolve, reject) => { resolve(render.toString()); @@ -133,6 +133,6 @@ export const GenerateDocument = async (template, messageOptions, sendType) => { }) ); } else { - displayTemplateInWindow(await RenderTemplate(template, bodyshop)); + await RenderTemplate(template, bodyshop); } }; diff --git a/server/render/inlinecss.js b/server/render/inlinecss.js index 543590638..18d87fc6b 100644 --- a/server/render/inlinecss.js +++ b/server/render/inlinecss.js @@ -17,6 +17,7 @@ exports.inlinecss = (req, res) => { inlineCssTool(html, { url: url }) .then((inlinedHtml) => { + console.log("Inline success."); res.send(inlinedHtml); }) .catch((error) => {