nodemailer-plugin-inline-base64
nodemailer-plugin-inline-base64 copied to clipboard
Uncaught error when content is loaded from file
Nodemailer supports loading content from a file:
var mail = {
data: {
html: {
path: __dirname + '/fixtures/message.html'
}
}
};
An error is raised when this plugin is used:
TypeError: Uncaught error: Object <p>example</p>
has no method 'replace'
at replaceBase64Images (/.../node_modules/nodemailer-plugin-inline-base64/src/replaceBase64Images.js:2:16)
This is happening because Nodemailer returns a buffer when a file is loaded, not a string.