I have a js
file contains the html content.
.js file
const data = (data) => { return `<h1> This is my pdf data </h1>`}export default data
This is my nodemailer function
import template from "js_file_path"const body = template(data);const mail = mailcomposer({ from: "XXXX", to: "XXXX", subject: `Subject`, attachments: [ { filename: "Receipt.pdf", content: body } ] }); // mail.build()
But this is not working. Can anyone suggest me the way to do this?