SparkPost / heml

HEML is an open source markup language for building responsive email.
https://heml.io
MIT License
4.33k stars 157 forks source link

New feature: convert inline image into e-mail attachement, no absolute url #21

Closed ahait closed 6 years ago

ahait commented 6 years ago

New feature proposal: Lets say i write img src=“x.jpg” and it converts it to inline image and attach it automatically as an inline attachment. No absolute URL. No need to look on "the internet" for the image, because it is attached in the e-mail, by heml. No need for clicking "Load remote images"-button in your e-mail client.

If I can help somehow, let me know.

avigoldman commented 6 years ago

Hey @ahait! Do you mean adding the image as a base 64 encoded value in the src attribute or actually attaching the image to the email?

ahait commented 6 years ago

Well its 2 different things, sorry for that. I am thinking about inline attached image...

avigoldman commented 6 years ago

This is an interesting idea to get around the remote images problem. Unfortunately there are a few problems with this approach if I'm understanding this correctly 😕

  1. Because of the size limit for messages your email is likely to get clipped if you inline your images
  2. The support for base64 encoded images isn't great or consistent

I don't think its best to add this as an option since it will likely cause more confusion then its worth and isn't really best practice.

If you really want this feature, I'd suggest creating a custom element (.i.e. <embed-img />) to use this functionality.

ahait commented 6 years ago

<embed-img tag is a good idea! I'll check it out.