Back to Sendgrid Nodejs

Specifying Custom Headers

docs/use-cases/custom-headers.md

8.1.6421 B
Original Source

Specifying Custom Headers

Use the headers property to specify any custom headers (note that these can also be set globally per the API specification:

js
const msg = {
  to: '[email protected]',
  from: '[email protected]',
  subject: 'Hello custom header',
  html: '<p>Some email content</p>',
  headers: {
    'X-CustomHeader': 'Custom header value',
  },
};