gotschmarcel / nodemailer-brevo-transport Goto Github PK
View Code? Open in Web Editor NEWBrevo Transport Module for Nodemailer
License: MIT License
Brevo Transport Module for Nodemailer
License: MIT License
seems that the attachment is mandatory for sending an email
Hi there,
first of all I would like to thank you for the outstanding job in creating this transporter for nodemailer as it saved hours of re-writing code after realizing that my host recently blocked the SMTP email function on their apps. The Transporter is working great but i struggle in embedding images in to the transporter. I have tried several ways including base64 encoding my images, but nothing seems to work.
Attempt 1:
function testMailConnection() {
logoPath = path.join(__dirname, '../public/assets/intu512.png');//It goes three folders or directories back from given __dirname.
var base64str = base64_encode(logoPath);
let emailTemplate = `initiation-email`;
let emailContext = {
subject: 'Server Initialized!',
title: 'Server Initialized successfully!',
body:`Server has established successfully contact to Brevo and is ready to send emails`
};
let from = `[email protected]`;
let to = `Support <[email protected]>`;
let subject = `Server Connection to Brevo established!`
//construct email options
let mail = {
from,
to,
subject,
template: emailTemplate,
context: emailContext,
images: [{
'type': "image/png",
'name': 'logocid',
'content': base64str
}]
};
Attempt 2
function testMailConnection() {
logoPath = path.join(__dirname, '../public/assets/intu512.png');//It goes three folders or directories back from given __dirname.
var base64str = base64_encode(logoPath);
let emailTemplate = `initiation-email`;
let emailContext = {
subject: 'Server Initialized!',
title: 'Server Initialized successfully!',
body:`Server has established successfully contact to Brevo and is ready to send emails`
};
let from = `[email protected]`;
let to = `Support <[email protected]>`;
let subject = `Server Connection to Brevo established!`
//construct email options
let mail = {
from,
to,
subject,
template: emailTemplate,
context: emailContext,
inline_image: {"logo" : base64str},
};
I would greatly appreciate if you could point us into the right direction.
Thanks for this great project. How can I use it with typescript?
Hi @gotschmarcel ,
Nice job on the package. I was asking if there was a way you could include a way to enable the use of templates and passing in the variables to the templates when sending the emails.
According to https://developers.sendinblue.com/docs/migration-guide-for-api-v2-users-1#why-do-i-have-to-migrate, the V2 API might be removed since June 25th 2021
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.