Is there a way to add a base64 image inside the body of my template? I attempted to send the content from my React app and utilized {{{ message }}} in my template, but it didn’t work. I also attempted to edit it as code and used this ‘ img src=”{{message}}” ‘ (this is an image tag). The message contained Base64 code for my image but it is not displaying. Is there a method to accomplish this?
const sendEmailNotification = (email, name) => {
const templateParams = {
to_email: email,
bcc: '[email protected]',
from_name: 'nametest',
to_name: name,
subject: 'Notification',
message: Here I want to send the src or the image with a Base 64 src
};
// Send email using email.js
emailjs.send(import.meta.env.VITE_EMAIL_JS_SERVICE_ID, import.meta.env.VITE_EMAIL_JS_TEMPLATE_ID, templateParams, import.meta.env.VITE_EMAIL_JS_USER_ID)
.then((response) => {
console.log('Email sent successfully!', response);
}, (error) => {
console.error('Email failed to send:', error);
});
};