Code Monkey home page Code Monkey logo

nodemailer-brevo-transport's People

Contributors

circles-00 avatar gotschmarcel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

nodemailer-brevo-transport's Issues

Embedding Images in Emails

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.

Transaction Email Templates

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.