I am trying to load an HTML email template file, manipulate its contents, and send it out using SendGrid and strapi’s email plugin. But for some reason, the HTML file is be compiled (it’s not included in the
dist folder). I get
ENOENT: no such file or directory,
If I move the HTML file intro
dist folder, it works fine.
This is the code sample .
The HTML file is in the same directory.
I think you want to put the file in public folder since it’s HTML then require it from there,
Thank you very much. This worked fine.
Hi what was the url to access the file in your public folder? I am having issues coming up with the right url for the path.
const html_template = readFileSync(path.join(__dirname, '../../../../../public/templates/order_paid.html'), 'utf8');
In the dist folder i dont see any of the public files. So how are they accessible from the build?