Lorsque vous utilisez '@sendgrid/mail' pour envoyer un e-mail, le champ 'à' n'accepte que les adresses e-mail simples, pas le format nom/e-mail (exemple : {nom :'John Doe', e-mail :'[email protected]'} ).
const sgMail = require('@sendgrid/mail');
sgMail.setApiKey(process.env.SENDGRID_API_KEY);
const msg = {
to: { email:'[email protected]', name: 'John Doe' },
from: '[email protected]',
subject: 'Sending with SendGrid is Fun',
text: 'and easy to do anywhere, even with Node.js',
html: '<strong>and easy to do anywhere, even with Node.js</strong>',
};
sgMail.send(msg);
Bonjour @agostonbonomi ,
Voici les méthodes prises en charge pour le formatage des e-mails.
S'il vous plaît laissez-moi savoir si cela aide.
Merci!
Meilleures salutations,
Elmer
salut @thinkingserious , merci pour ça. j'ai raté ça dans la doc, ça marche bien :)
Merci pour le suivi @agostonbonomi !