Adding a name to the “from” field in SendGrid in Node.js

后端 未结 4 1745
粉色の甜心
粉色の甜心 2020-12-15 05:55

I want to add a name to my \"from\" field using the SendGrid API, but I do not know how to do this. I tried setting the \"from\" parameter in sendgrid.send to <

4条回答
  •  春和景丽
    2020-12-15 06:04

    Although the updated use cases don't include the from key

    https://github.com/sendgrid/sendgrid-nodejs/blob/master/docs/use-cases/flexible-address-fields.md

    This one worked for me

      to: 'user@userdomain.com',
      from: {
          name: 'Sender'
          email: 'me@mydomain.com',
      },
      subject: 'Hello World',
      html: `

    Hello World

    ` });

提交回复
热议问题