Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

297
Views
Emojis y caracteres especiales que no se representan en el encabezado del asunto en Pug usando Sendgrid

Por favor, el problema es que ningún emoji o carácter especial se muestra en el encabezado del tema del archivo pug. pero trabajando perfectamente en el cuerpo. Compilo tanto el cuerpo como el encabezado del asunto de manera diferente usando pug.

 const compileHtmlFunction = pug.compileFile( path.join(__dirname, "../emails", templatePath, "html.pug") ); const getSubjectFunction = pug.compileFile( path.join(__dirname, "../emails", templatePath, "subject.pug") ); const payload = { DestinationEmail: to, SourceEmail: fromEmail ? `Switch By Sterling ${fromEmail}` : "Switch By Sterling team@switch-ng.com", Body: compileHtmlFunction(data), Subject: getSubjectFunction(data) };

"""""""""""""""""""""""""""""""html.pug

 doctype html include ../../layouts/header div(style='display: none; max-height: 0; overflow: hidden;') div(style='background-color: #ecedfa; line-height: 30px; padding-top:5px;') div(style='background-color: #ffffff; color: #484347; margin: 0 auto; margin-top: 100px; max-width: 400px; padding: 20px;') div center img(src='https://res.cloudinary.com/dzkyrqr5e/image/upload/v1648553921/new-headers/password-reset_ait4kd.png' alt='' width='100%' height="100%" border='0' style='display: block; margin: 20px auto 20px auto;') p(style='margin: 0 0 5px 0;') | Hello #{first_name}, br | You are receiving this email because there has been a password change request on your account. | If you initiated this request, please change your password by clicking the 'Change my password' button below. The link will expire after 10 minutes. br a(href=updatePasswordUrl) Change my password br | If you didn't request this, please ignore this email. Your password won't change until you access the link above and create a new one. br p(style='margin: 0') With 💜 | Your friends at Switch include ../../layouts/footer_image

""""""""""""""""""""""""""""sujeto.pug

 | Launch 💜
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

La línea de asunto de un correo electrónico no se representa como un archivo HTML, por lo que no creo que desee escapar del emoji en el asunto.

Intente cambiar su archivo subject.pug a:

 | Launch 💜
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!