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

214
Vistas
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 Respuestas
Responde la pregunta

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 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