email-builder-js icon indicating copy to clipboard operation
email-builder-js copied to clipboard

Feature Request: Support Embedding Local Image Files in HTML Files

Open jerryokk opened this issue 1 year ago • 4 comments

The current system does not support embedding local image files in HTML files. This causes inconvenience for users as they have to first upload images to online storage and then use the image links in HTML.

We need to add a feature that allows users to read image files directly from the local file system and embed them into HTML files. This will improve the user experience and streamline the workflow.

As described in this Stack Overflow question: https://stackoverflow.com/questions/74885017/node-js-reading-local-image-file-and-use-them-in-html-files

<img src="data:image/png;base64,${img}" />

jerryokk avatar May 06 '24 10:05 jerryokk

Additionally, to facilitate the usage in Nodemailer, the supported HTML format and attachments object can be exported. As described in this link https://community.nodemailer.com/using-embedded-images/, this is a very useful improvement that can enhance the user experience and make HTML emails look more professional and appealing.

image

jerryokk avatar May 06 '24 10:05 jerryokk

@jerryokk Gmail does not render base64 encoded images, this would work on Outlook but it's not going to work on all mail clients.

JadinAndrews avatar May 13 '24 09:05 JadinAndrews

Gmail 不会呈现 base64 编码的图像,这适用于 Outlook,但不适用于所有邮件客户端。

When used with Nodemailer, it can automatically convert base64 encoded images into attachments. So this should be a great feature, otherwise you would need to maintain an image hosting server.

jerryokk avatar May 17 '24 13:05 jerryokk

This is a good idea but, unfortunately, Base 64 images are not well supported (as mentioned by @JadinAndrews).

With Nodemailer, do you know if these are treated as standard images or simply attachments? If it's converted as a standard attachment, it may not be prefereable since logos and other context images would be out of context of the content.

jordanisip avatar May 31 '24 16:05 jordanisip