eleith / emailjs

html emails and attachments to any smtp server with nodejs
MIT License
2.19k stars 230 forks source link

embedding image #289

Closed velociwabbit closed 3 years ago

velociwabbit commented 3 years ago

I am not sure whether to mention this here or in your website but embedding svg images is unclear with the docs that you presently provide.

I have an image called betimg where the first few chars are

"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDo..."

I want to embed it into an email. I have successfully sent it as template_params value

template_params : { betimg: 'data:image/svg+xml;base64,PH..." }

and have added a content-ID value to the the fetch

xhr.setRequestHeader('Content-ID' , 'betimg' )

also on the template have added it as a parameter and a file name

and nothing I do with the template works to render the image

It is unclear whether your template {{betimg}} would be sufficient or do I need to declare an HTML section and embed it there? and if so will the following work <img src="cid:betimg" />

or do I need something like this:

<HTML><body><img src="cid:betimg" /></body></HTML>

And if HTML is disabled is there another way to embed an image? I think that the email spec provides it but your docs are sparse.

Example templates that include embedded images would be helpful.

Just to be clear and hopefully give you an alarm bell that this is a serious quality problem.

Emailjs has been around for many years and this issue is not covered properly on your website.

I am a small customer now but hope to be a bigger one...

zackschuster commented 3 years ago

@velociwabbit are you referring to https://www.emailjs.com? that's a separate (now-defunct) project unaffiliated with us. you cannot use this library to send emails from the browser.

zackschuster commented 3 years ago

closing as stalled