const sgMail = require('@sendgrid/mail');
sgMail.setApiKey(process.env.SENDGRID_API_KEY);
sgMail.setSubstitutionWrappers('{{', '}}'); // Configure the substitution tag wrappers globally
const msg = {
to: 'eschoellhorn@352inc.com',
from: process.env.SENDGRID_FROM_EMAIL,
// subject: 'Hello world',
// text: 'Hello plain world!',
// html: '<p>Hello HTML world!</p>',
templateId: process.env.SENDGRID_TEMPLATE_ID,
substitutions: {
PlanSponsorType: 'Golden Platinum Elite',
InviteURL: 'http://352inc.com',
},
};
sgMail
.send(msg)
.then(console.log)
.catch(console.error);