nodemailer-plugin-inline-base64 icon indicating copy to clipboard operation
nodemailer-plugin-inline-base64 copied to clipboard

Uncaught error when content is loaded from file

Open gergoerdosi opened this issue 9 years ago • 1 comments

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.

gergoerdosi avatar May 12 '15 14:05 gergoerdosi