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