Notify offline users of new message

I need to notify my users when a message has been sent to a group channel they are belong to when they are offline. I’d like to confirm that, at a high-level, this is what I need:

  1. An endpoint listening to the group_channel:message_send webhook
  2. When a webhook is received at the above endpoint, get each user and check if they are online
  3. Send an email or SMS (via a different system) to those users who are not online.

Are there different webhooks or endpoints I should be using to make this easier? For instance, is there an ‘unread message’ webhook? Thanks in advance!

Hi @kevinATfohANDboh,

I assume based on the path you’re taking that you’re not developing this on a mobile platform. If that is the case, webhooks would be your best bet. You can enable member data on the webhook which contains the users online status as well as the number of unread messages. It looks like this:

{
      "is_blocking_sender": false,
      "unread_message_count": 116,
      "total_unread_message_count": 116,
      "is_active": true,
      "is_online": false,
      "is_hidden": 0,
      "channel_mention_count": 0,
      "nickname": "exampleUser01",
      "is_blocked_by_sender": false,
      "user_id": "exampleUser01",
      "channel_unread_message_count": 1,
      "do_not_disturb": false,
      "state": "joined",
      "push_enabled": true,
      "push_trigger_option": "default",
      "profile_url": "",
      "metadata": {}
    }

From there you’d just want to send your email or SMS.