2.6.5 Notifications & Messaging

Objective: Notify users of trade updates, private messages, marketing offers, or important account changes.

1. Email

• Integrate SendGrid or AWS SES to send verification emails, password resets, and daily/weekly summaries.

2. SMS (Twilio)

• Used sparingly, e.g., for MFA codes or urgent trade alerts.

3. Push Notifications

• APNs for iOS, Firebase Cloud Messaging (FCM) for Android.

• Real-time alerts even when the app is closed (e.g., “DOGE price up 10%!”).

// backend/src/services/emailService.js
const sgMail = require('@sendgrid/mail');
sgMail.setApiKey(process.env.SENDGRID_API_KEY);

async function sendTradeAlert(userEmail, tradeDetails) {
  const msg = {
    to: userEmail,
    from: 'alerts@sumplus1.com',
    subject: 'Trade Update',
    text: `A new trade occurred: ${JSON.stringify(tradeDetails)}`,
  };
  await sgMail.send(msg);
}

Last updated