allenA
Convex Communityβ€’2y agoβ€’
7 replies
allen

SendGrid Example?

I am trying the most basic SendGrid implementation in an action (which works fine in regular NodeJs env), but getting the following error, even though I'm not using SendGrids template substitutions.

Uncaught TypeError: Cannot read properties of undefined (reading 'substitutionWrappers')

The code is as follows:

  const sgMail = require('@sendgrid/mail');
  sgMail.setApiKey(process.env.SENDGRID_API_KEY);
  await sgMail.send({
      to,
      subject,
      from,
      text,
  });


Anyone have success integrating SendGrid in Convex?
Was this page helpful?