Introduced JS report and refactored some doc generation. IO-585

This commit is contained in:
Patrick Fic
2021-01-06 17:56:46 -08:00
parent 1c967ece2e
commit 2d260dceb8
33 changed files with 311 additions and 676 deletions

View File

@@ -6,16 +6,24 @@ require("dotenv").config({
),
});
const inlineCssTool = require("inline-css");
const mailjet = require("node-mailjet").connect(
process.env.email_api,
process.env.email_secret
);
exports.sendEmail = (req, res) => {
exports.sendEmail = async (req, res) => {
if (process.env.NODE_ENV !== "production") {
console.log("[EMAIL] Incoming Message", req.body.from.name);
}
// const inlinedCssHtml = await inlineCssTool(req.body.html, {
// url: "https://imex.online",
// });
// console.log("inlinedCssHtml", inlinedCssHtml);
const request = mailjet.post("send", { version: "v3.1" }).request({
Messages: [
{
@@ -36,13 +44,6 @@ exports.sendEmail = (req, res) => {
// "Dear passenger 1, welcome to Mailjet! May the delivery force be with you!",
HTMLPart: req.body.html,
Attachments: req.body.attachments || null,
// Attachments: [
// {
// ContentType: "text/plain",
// Filename: "test.txt",
// Base64Content: "VGhpcyBpcyB5b3VyIGF0dGFjaGVkIGZpbGUhISEK",
// },
// ],
},
],
});