usewaypoint / email-builder-js

A free and open-source block-based email template builder.
https://emailbuilderjs.com
MIT License
307 stars 92 forks source link

Feature Request: Support Embedding Local Image Files in HTML Files #98

Open jerryokk opened 2 months ago

jerryokk commented 2 months ago

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 commented 2 months ago

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

JadinAndrews commented 2 months ago

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

jerryokk commented 1 month ago

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.

jordanisip commented 1 month ago

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.