Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

315
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda