Skip to main content

Notifications

sendNotification - sends a notification to a user and stores it in the database:

await sendNotification(studentUserId, "New feature available", "Check out the new feature in your dashboard");

It will look like this:

notification ui

Sending emails

If you also want the notification to be sent by email, specify:

  • isExternal = true as a fourth argument into sendNotification function
  • FD_SEND_EMAIL = true in .env
  • register with SendGrid to get and configure FD_EMAIL_SERVICE_URL and FD_SERVICE_KEY in .env
await sendNotification(
studentUserId,
"New feature available",
"Check out the new feature in your dashboard",
true,
);

Functions for showing simple toast UI notifications:

notify("Notify message");
notifySuccess("Notify success message");
notifyFailure("Notify failure message");

It will look like this:
toaster ui