Skip to main content

Reminders

Create reminders for messages or anything else.

Image

Extension Settings

  1. Login to CometChat and select your app.
  2. Go to the Extensions section and enable the Reminders extension.
  3. Go to the Users section and create a new user with cc_reminder_bot as the UID. The name and Avatar can be of your choice.
info

The cc_reminder_bot user should be available for your app in order to use the Reminders extension. There shouldn't be an existing user using the same UID.

How do reminders work?

Image

Users can choose to be reminded about a message from a conversation or set some sort of custom personalized reminder.

When the reminder is due, cc_reminder_bot will send a message to the user.

Users can then list, edit or delete reminders.

Set reminders

The following parameters are required for setting a reminder

ParameterValueDescription
aboutInteger/StringInteger => For setting a message reminder.

String => For setting a personal reminder.
isCustomBooleanfalse => For setting a message reminder.

true => For setting a personal reminder.
timeInMSIntegerUnix timestamp: (e.g.: 1638351344989)

Message reminders

To set Message reminders, the about should be an integer corresponding to the message id. The isCustom value should be set tofalse.

In order to set the reminders, use the CometChat.callExtension method as shown below:

CometChat.callExtension('reminders', 'POST', 'v1/reminder', {
about: 1,
isCustom: false,
timeInMS: 1638351344989
}).then(response => {
// Reminder created successfully
// Reminder details with reminderId.
}).catch(error => {
// Some error occured
});

Personal reminders

To set Personal reminders, the about can contain the description. The isCustom value should be set totrue.

In order to set the reminders, use the CometChat.callExtension method as shown below:

CometChat.callExtension('reminders', 'POST', 'v1/reminder', {
about: "Drinking water",
isCustom: true,
timeInMS: 1638351344989
}).then(response => {
// Reminder created successfully
// Reminder details with reminderId.
}).catch(error => {
// Some error occured
});

If the reminder has been created successfully, you will receive the reminder object with reminderId in the success response.

List reminders

List the reminders set by a user using the CometChat.callExtension method as shown below:

CometChat.callExtension('reminders', 'GET', 'v1/fetch', null).then(response => {
// reminders array
}).catch(error => {
// Some error occured
});

Delete reminders

Reminders can be deleted using the reminderId as shown below:

CometChat.callExtension('reminders', 'DELETE', 'v1/reminder', {
reminderId: "e9cda52a-3839-4fd5-a010-b70db136f0f1"
}).then(response => {
// Reminder deleted successfully
}).catch(error => {
// Some error occured
});

Edit reminders

In case a reminder needs to be preponed or postponed, it can be done using the Edit reminders functionality. The following updates the reminder with reminderId: "e9cda52a-3839-4fd5-a010-b70db136f0f1"

For editing, use the CometChat.callExtension method as shown below:

CometChat.callExtension('reminders', 'PUT', 'v1/reminder', {
reminderId: "e9cda52a-3839-4fd5-a010-b70db136f0f1",
about: 1,
isCustom: false,
timeInMS: 1638351344999
}).then(response => {
// Reminder updated successfully.
}).catch(error => {
// Some error occured
});
info

For Message reminders, timeInMS can be updated.
For Personal reminders, timeInMS & about can be updated.

Receive reminders

The user will receive reminders from a special user - cc_reminder_bot - that was configured before.

These reminders are sent as messages with category: custom and type: extension_reminders. The customData object will have an about field that the user had mentioned while setting the reminder.

Learn more about Custom messages listener for receiving reminders.