Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
jerryokk opened this issue May 6, 2024 · 4 comments
Open
Labels
question Further information is requested

Comments

@jerryokk
Copy link

jerryokk commented May 6, 2024

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
Copy link
Author

jerryokk commented May 6, 2024

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
Copy link

@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
Copy link
Author

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
Copy link
Contributor

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 jordanisip added the question Further information is requested label May 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants