Back to Sendgrid Nodejs

Specifying Categories

docs/use-cases/categories.md

8.1.6584 B
Original Source

Specifying Categories

Use the categories property to provide an array of categories for your email:

js
const msg = {
  to: '[email protected]',
  from: '[email protected]',
  subject: 'Hello email with categories',
  html: '<p>Some email content</p>',
  categories: [
    'transactional', 'customer', 'weekly',
  ],
};

Specifying a single category is also supported:

js
const msg = {
  to: '[email protected]',
  from: '[email protected]',
  subject: 'Hello email with categories',
  html: '<p>Some email content</p>',
  category: 'transactional',
};