// enable reminders for the channel type `messaging`
await client.updateChannelType("messaging", {
reminders: true,
});
// change reminders interval to 1 hour
await client.updateAppSettings({ reminders_interval: 3600 });
Reminders
Reminders allow you to notify users about messages they did not read. Reminders can be used to trigger an email, push notification or SMS to the user.
When enabled, Stream Chat will send a reminder event to your web-hook or SQS queue every time a user has an unread message in a channel with 10 members or less for longer than five minutes.
By default, a reminder will be sent if the user did not read the message within 5 minutes. This interval can be changed for your application. Any interval in seconds between 60 and 86,400 seconds (24 hours) is allowed. If there are more messages sent after a reminder was sent, we will send another reminder for the new messages.
Reminders are configurable as channel type features, by default this feature is disabled. Make sure to enable it for your channel types. This can be done using the API or from the Dashboard.
# enable reminders for the channel type `messaging`
client.update_channel_type("messaging", reminders=True)
# change reminders interval to 1 hour
client.update_app_settings(reminders_interval=3600);
# enable reminders for the channel type `messaging`
client.update_channel_type("messaging", reminders: true)
# change reminders interval to 1 hour
client.update_app_settings(reminders_interval: 3600);
// enable reminders for the channel type `messaging`
await channelTypeClient.UpdateChannelTypeAsync(channelType.Name, new ChannelTypeWithStringCommandsRequest
{
Reminders = True,
});
// change reminders interval to 1 hour
await appClient.UpdateAppSettingsAsync(new AppSettingsRequest
{
RemindersInterval = 3600,
});
// enable reminders for the channel type `messaging`
client.UpdateChannelType(ctx, "messaging", map[string]interface{}{"reminders": true})
// change reminders interval to 1 hour
client.UpdateAppSettings(ctx, &AppSettings{RemindersInterval: 3600})
// Backend SDK
// enable reminders for the channel type `messaging`
ChannelType.update("messaging").reminders(true).request();
// change reminders interval to 1 hour
App.update().remindersInterval(3600).request();
// enable reminders for the channel type `messaging`
$client->updateChannelType("messaging", ["reminders" => true]);
// change reminders interval to 1 hour
$client->updateAppSettings(["reminders_interval" => 3600]);
// This can be enabled in https://dashboard.getstream.io/ -> Open your application -> Channel Types -> Pick Channel Type you use for your Channels -> Enable "Message Reminders"
Reminders are sent only if all conditions are met:
The channel has 10 members or less
The channel type has the
reminders
feature enabledThe channel has at least one unread message
The channel has the
read_events
feature enabledThe unread message(s) type is
regular
orsystem
The unread message is not deleted
The channel is not deleted
The channel member limit (default 10) can be adjusted by contacting support
Reminder Event
Reminder events contain all the information needed to send a notification to the user without additional API calls. This makes it easy to pipe email/push/sms services.
Field | Value |
---|---|
type | The type of the event, reminders have type user.unread_message_reminder |
user | The target user for this the reminder. This is the user that did not mark the channel as read |
channels | The object containing all channels with at least one unread message for this user |
created_at | The time the event was sent |
The channels object contains up to 10 objects and have this structure
Field | Value |
---|---|
channel | The channel object, this includes the list of members. |
messages | The last five messages in the channel (in descending order) |
{
"type": "user.unread_message_reminder",
"created_at": "2022-09-22T12:11:01.258013863Z",
"user": {
"id": "jose",
"role": "user",
"created_at": "2021-08-20T08:16:15.591073Z",
"updated_at": "2022-09-22T12:07:39.675943Z",
"last_active": "2022-09-21T09:49:09.750498Z",
"banned": false,
"online": false,
"teams": ["blue"],
"name": "jose"
},
"channels": {
"messaging:!members-NsJg6rJv7n1wrpi4NyA5zNGBCpih_eYaQdY6KARmEHo": {
"channel": {
"id": "!members-NsJg6rJv7n1wrpi4NyA5zNGBCpih_eYaQdY6KARmEHo",
"type": "messaging",
"cid": "messaging:!members-NsJg6rJv7n1wrpi4NyA5zNGBCpih_eYaQdY6KARmEHo",
"last_message_at": "2022-09-22T12:10:01.833367Z",
"created_at": "2022-08-24T17:19:28.792836Z",
"updated_at": "2022-08-24T17:19:28.792836Z",
"created_by": {
"id": "pepe",
"role": "user",
"created_at": "2022-08-10T10:16:04.809462Z",
"updated_at": "2022-08-12T14:41:06.628463Z",
"last_active": "2022-08-24T17:36:27.247247Z",
"banned": false,
"online": false
},
"frozen": false,
"disabled": false,
"members": [
{
"user_id": "jose",
"user": {
"id": "jose",
"role": "user",
"created_at": "2021-08-20T08:16:15.591073Z",
"updated_at": "2022-09-22T12:07:39.675943Z",
"last_active": "2022-09-21T09:49:09.750498Z",
"banned": false,
"online": false,
"teams": ["blue"],
"name": "jose"
},
"created_at": "2022-08-24T17:19:28.802613Z",
"updated_at": "2022-08-24T17:19:28.802613Z",
"banned": false,
"shadow_banned": false,
"role": "member",
"channel_role": "channel_member"
},
{
"user_id": "pepe",
"user": {
"id": "newTest",
"role": "user",
"created_at": "2022-08-10T10:16:04.809462Z",
"updated_at": "2022-08-12T14:41:06.628463Z",
"last_active": "2022-08-24T17:36:27.247247Z",
"banned": false,
"online": false
},
"created_at": "2022-08-24T17:19:28.802613Z",
"updated_at": "2022-08-24T17:19:28.802613Z",
"banned": false,
"shadow_banned": false,
"role": "owner",
"channel_role": "channel_member"
}
],
"member_count": 2,
"config": {
"created_at": "2021-10-05T16:07:41.544996Z",
"updated_at": "2022-09-22T11:59:47.660541Z",
"name": "messaging",
"typing_events": true,
"read_events": true,
"connect_events": true,
"search": true,
"reactions": true,
"replies": true,
"quotes": true,
"mutes": true,
"uploads": true,
"url_enrichment": true,
"custom_events": true,
"push_notifications": true,
"reminders": true,
"message_retention": "infinite",
"max_message_length": 5000,
"automod": "disabled",
"automod_behavior": "flag",
"blocklist": "prohibido",
"blocklist_behavior": "block",
"automod_thresholds": {},
"commands": [
{
"name": "giphy",
"description": "Post a random gif to the channel",
"args": "[text]",
"set": "fun_set"
},
{
"name": "ban",
"description": "Ban a user",
"args": "[@username] [text]",
"set": "moderation_set"
},
{
"name": "unban",
"description": "Unban a user",
"args": "[@username]",
"set": "moderation_set"
},
{
"name": "mute",
"description": "Mute a user",
"args": "[@username]",
"set": "moderation_set"
},
{
"name": "unmute",
"description": "Unmute a user",
"args": "[@username]",
"set": "moderation_set"
}
]
}
},
"messages": [
{
"id": "8009180a-ef37-4818-b4fd-e69a7312d77e",
"text": "hola",
"html": "<p>hola</p>\n",
"type": "regular",
"user": {
"id": "pepe",
"role": "user",
"created_at": "2022-08-10T10:16:04.809462Z",
"updated_at": "2022-08-12T14:41:06.628463Z",
"last_active": "2022-08-24T17:36:27.247247Z",
"banned": false,
"online": false
},
"attachments": [],
"latest_reactions": [],
"own_reactions": [],
"reaction_counts": null,
"reaction_scores": null,
"reply_count": 0,
"cid": "messaging:!members-NsJg6rJv7n1wrpi4NyA5zNGBCpih_eYaQdY6KARmEHo",
"created_at": "2022-09-22T12:05:05.641171Z",
"updated_at": "2022-09-22T12:05:05.641171Z",
"shadowed": false,
"mentioned_users": [],
"silent": false,
"pinned": false,
"pinned_at": null,
"pinned_by": null,
"pin_expires": null
}
]
}
}
}