I'm making a node.js server which sends emails on demand. The variable "output" is what I want to send via email. When I use inline html it works fine, however I want to import a complete html file instead.
I've tried using <object> and <link> to import "file.html" which is in the same folder as app.js, but both show up as a white page.
app.post("/send", (req, res) => {
console.log("sending email...");
const email = req.body.data.email;
const customerId = req.body.data.customer_id;
const orderId = req.body.data.order_id;
//const output = `<h3>Hi, this works</h3>` // WORKS
//const output = `<object type="text/html" data="file.html"></object>`; // Doesn't work
const output = `<link href="file.html" rel="import" />`; // Doesn't work
;
Help is much appreciated. I can supply more code if necessary.