Closed ibc closed 6 years ago
I will add in https://github.com/ladjs/nodemailer-base64-to-s3/ soon as built-in - but if you want to use this manually in meanwhile that would be nice.
Finally it was possible to disable Base64 image encoding by setting some configuration options in juice
.
@ibc please share your documentation and options? 👍
Actually you can add data-inline-ignore
attribute within the corresponding <img>
tag, or you can disable it globally by setting:
{
juice: {
webResources: {
images : false
}
}
}
Check https://www.npmjs.com/package/juice API, specifically the webResources
setting which points to https://www.npmjs.com/package/web-resource-inliner
Finally thanks @ibc
@macpatel @ibc I've released v4.0.2 which sets images: false
in the built-in configuration of email-templates
. I also added a note to the README regarding this here https://github.com/niftylettuce/email-templates#plugins.
I also released a deprecation notice to NPM versions <4.0.2:
npm deprecate email-templates@"<4.0.2" "If you are using <4.0.2, you may have an issue in production with <img> tags 'src' attribute being converted to an inlined base64 data-uri, as of v4.0.2+ we have specifically set 'images: false' in the options we pass to 'juice' so that images will not get converted this way. See <https://github.com/niftylettuce/email-templates/issues/303> for more information and consider using 'nodemailer-base64-to-s3' as documented here <https://github.com/niftylettuce/email-templates\#plugins>"
Great! thanks a lot.
PS: This issue can be closed :)
Done @ibc!
AFAIS, if the
html.ejs
template includes a<img src="https://foo.com/image.png">
, it happens thatemail-templates
converts it to Base64 within the email HTML body.Thanks.