Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

318
Vistas
Send email with attachments after a file is generated

I’m running an approval flow that generates an index.html table file with all items requested.

There is a button to approve all requests and a button to generate a .csv file.

I need to send an email to whoever approves the request (after clicking the “approve all” button) with the .csv file as an attachment. Is there any way I can do this?

Thanks in advance.

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Nodemailer supports different ways of setting attachments.

var nodemailer = require('nodemailer');
        

 var transporter = nodemailer.createTransport({
      host: 'host.com',
      port: 465,
      secure: true,
      service: 'gmail',
      auth: {
           user: 'user@gmail.com',
           pass: 'gmailpassword'
      }
});
    
var mailOptions = {
     from: 'sender@gmail.com',
     to: 'receiver@gmail.com',
     subject: 'CSV File',
     text: 'Hello world',
     html: '<b>Hello world</b>',
     attachments: [{
         filename: 'csv-file.csv', // file name
         path: '/path/to/csv-file.csv' // file path
     }]
 };

// send mail
transporter.sendMail(mailOptions, function(error, info){
    if(error){
        console.log(error);
    }
    console.log(info.response);
});

you can use convert data into CSV before sending it. Use module like papaparse.
NodeMailer -> Nodemailer Repository GitHub

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda