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

213
Visualizações
using html template with firebase functions nodemailer

I want to send an email to users with nodemailer. I have an html template but I cannot use it. Template html file is under functions folder (same folder with index.js) What should I write in html section for nodemailer?

const mailOptions = {
    from: `blabla@blabla.com`,
    to: snap.data().email,
    subject: 'blablabla welcome',
    html: '', // ???
  };
about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

As stated in the message configuration:

The following are the possible fields of an email message:

  • from - The email address of the sender. All email addresses can be plain ‘sender@server.com’ or formatted '“Sender Name” sender@server.com', see Address object for details
  • to - Comma separated list or an array of recipients email addresses that will appear on the To: field
  • subject - The subject of the email.
  • text - The plaintext version of the message as an Unicode string, Buffer, Stream or an attachment-like object ({path: ‘/var/data/…'})
  • html - The HTML version of the message as an Unicode string, Buffer, Stream or an attachment-like object ({path: ‘http://…'})
var message = {
  from: "sender@server.com",
  to: "receiver@sender.com",
  subject: "Message title",
  text:  "Plaintext version of the message",
  html: "<p>HTML version of the message</p>"
};

In short, those are the most common values used to send an email message. The html field is used to put the body of the message using HTML to format it. If you only want to send it in plaintext (without formatting) or to provide fallback support to devices with plaintext support only, you can use the text field alongside or instead of html field.

See also

  • Nodemailer 2.x
  • Cloud Functions for Firebase, sending email
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