Diveboard / diveboard-v2

GNU General Public License v3.0
2 stars 4 forks source link

Do not use the SPAM groups on Sendgrid when sending OTP emails #19

Open zatmonkey opened 1 year ago

zatmonkey commented 1 year ago

Users who have reported Diveboard as SPAM are added to spam groups, which will cancel email delivery from sendgrid. While it's great to avoid spamming people, OTP email should always be sent. image

zatmonkey commented 1 year ago

Let's move to direct email send from the backend (not using the Firebase functions) I created a transactional template

const sgMail = require('@sendgrid/mail');
sgMail.setApiKey(process.env.SENDGRID_API_KEY);
const msg = {
  to: 'recipient@example.org',
  from: 'no-reply@diveboard.com',
  templateId: 'f8501d9c-09c9-43c1-ab71-5ddad55cf6e0',
  dynamicTemplateData: {
    otp: '123456',
  },
};
sgMail.send(msg);