1const sgMail = require('@sendgrid/mail');
2sgMail.setApiKey(process.env.SENDGRID_API_KEY);
3const msg = {
4 to: 'recipient@example.org',
5 from: 'sender@example.org',
6 templateId: 'd-f43daeeaef504760851f727007e0b5d0',
7 dynamic_template_data: {
8 subject: 'Testing Templates',
9 name: 'Some One',
10 city: 'Denver',
11 },
12};
13sgMail.send(msg);