Customer Reminders

Learn how customer reminders help you build scalable customer engagement applications on the Elarian Framework.

Reminders allow you to schedule payload on a customer that your app will be notified about some time in the future. Once your app is notified you can use the payload you set to determine how to engage with the customer next.

Add reminder

...

const customer = new client.Customer({...});

const resp = await customer.addReminder({
  key: 'paymentPrompt',
  remindAt: new Date(2025, 1, 1).getTime() / 1000,
  payload: JSON.stringify({ paymentId: 20 })
});

console.log(resp);

Receive reminder

...

client.on('reminder', (notification, customer, appData) => {
  /*
  {
    key: '...',
    remindAt: ...,
    payload: '...' 
  }
  */
  console.log(notification.reminder);
});

Cancel reminder

...

const resp = await customer.cancelReminder('paymentPrompt');

console.log(resp);