Reminders

This guide will cover how to setup reminder schedules.

Reminder schedules enable a sender to choose how often to notify the signer(s) about a pending signature; in addition to the initial notification sent the moment the package (transaction in the UI) is sent for signing.

The Code

Full code for this guide can be found in the Developer Community Code Share, here.

Below is a sample code on how you would create your ReminderSchedule object. You will need to pass your packageId object as a parameter to the ReminderScheduleBuilder, along with the settings that suits your requirement. Since you need a packageId to set your reminder schedule, you will need to do this AFTER you have created the package, but BEFORE you send it, so if you’re using the createAndSendPackage() method to send your packages, you’ll need to split it up.

The withDaysUntilFirstReminder() method allows you to wait a certain amount of days before sending the first reminder. This will not affect the initial notification sent the moment your document package is sent for signing. The withDaysBetweenReminders() method sets the frequency of your reminders. The withNumberOfRepetitions() method sets the number of reminders OneSpan Sign will send to your signer(s), with a maximum of 5 reminders. Once you’ve built your ReminderSchedule object, you call on your OneSpan Sign ReminderService to create your reminder schedule.

ReminderSchedule reminderScheduleToCreate = ReminderScheduleBuilder.forPackageWithId(packageId)
               .withDaysUntilFirstReminder(1)
               .withDaysBetweenReminders(1)
               .withNumberOfRepetitions(5)
      .build();

eslClient.getReminderService().createReminderScheduleForPackage(reminderScheduleToCreate);

Similarly, once you’ve sent your document package for signing, you can update your reminder schedule by creating a new ReminderSchedule object with different parameters and calling on your OneSpan Sign ReminderService.

eslClient.getReminderService().updateReminderScheduleForPackage(reminderScheduleToUpdate);

You can also retrieve your ReminderSchedule object by calling on your OneSpan Sign ReminderService. By doing so, you will also get all the reminders that have been sent to your signer(s). Reminders are returned as a list.

ReminderSchedule reminderSchedule = client.getReminderService().getReminderScheduleForPackage(packageId);
		
List<Reminder> reminders = reminderSchedule.getReminders();
		
for (Reminder reminder : reminders) {
     System.out.println(reminder.getSentDate());
}

To delete your reminder schedule, you likewise call on your OneSpan Sign ReminderService.

eslClient.getReminderService().clearReminderScheduleForPackage(packageId);

Running Your Code

In this guide, a notification is sent to a signer once a day. Below is a screenshot of the notification emails received by the signer for a pending signature.

Notification Email

Included in this guide is the code that prints out the sent date of each reminder to the console. Below is a screenshot of what such an output would look like.

Java Console

Get the Code

Reminder schedules enable a sender to choose how often to notify the signer(s) about a pending signature; in addition to the initial notification sent the moment the package (transaction in the UI) is sent for signing.

The Code

Full code for this guide can be found in the Developer Community Code Share, here.

Below is a sample code on how you would create your ReminderSchedule object. You will need to pass your packageId object as a parameter to the ReminderScheduleBuilder, along with the settings that suits your requirement. Since you need a packageId to set your reminder schedule, you will need to do this AFTER you have created the package, but BEFORE you send it, so if you’re using the createAndSendPackage() method to send your packages, you’ll need to split it up.

The withDaysUntilFirstReminder() method allows you to wait a certain amount of days before sending the first reminder. This will not affect the initial notification sent the moment your document package is sent for signing. The withDaysBetweenReminders() method sets the frequency of your reminders. The withNumberOfRepetitions() method sets the number of reminders OneSpan Sign will send to your signer(s), with a maximum of 5 reminders. Once you’ve built your ReminderSchedule object, you call on your OneSpan Sign ReminderService to create your reminder schedule.

ReminderSchedule reminderScheduleToCreate = ReminderScheduleBuilder.ForPackageWithId(packageId)
               .WithDaysUntilFirstReminder(1)
               .WithDaysBetweenReminders(1)
               .WithNumberOfRepetitions(5)
      .Build();

eslClient.ReminderService.CreateReminderScheduleForPackage(reminderScheduleToCreate);

Similarly, once you’ve sent your document package for signing, you can update your reminder schedule by creating a new ReminderSchedule object with different parameters and calling on your OneSpan Sign ReminderService.

eslClient.ReminderService.UpdateReminderScheduleForPackage(reminderScheduleToUpdate);

You can also retrieve your ReminderSchedule object by calling on your OneSpan Sign ReminderService. By doing so, you will also get all the reminders that have been sent to your signer(s). Reminders are returned as a list.

ReminderSchedule createdReminderSchedule = eslClient.ReminderService.GetReminderScheduleForPackage(packageId);

List<Reminder> reminders = createdReminderSchedule.Reminders;

foreach (Reminder reminder in reminders)
{
     Debug.WriteLine(reminder.SentDate);
}

To delete your reminder schedule, you likewise call on your OneSpan Sign ReminderService.

eslClient.ReminderService.ClearReminderScheduleForPackage(packageId);

Running Your Code

In this guide, a notification is sent to a signer once a day. Below is a screenshot of the notification emails received by the signer for a pending signature.

Notification Email

Included in this guide is the code that prints out the sent date of each reminder to the console. Below is a screenshot of what such an output would look like.

CSharp Console

Get the Code

Reminder schedules enable a sender to choose how often to notify the signer(s) about a pending signature; in addition to the initial notification sent the moment the package (transaction in the UI) is sent for signing.

The Code

Full code for this guide can be found in the Developer Community Code Share, here.

You can create a reminder schedule by making the following request:

HTTP Request
POST /api/packages/{packageId}/reminders

HTTP Headers
Accept: application/json
Content-Type: application/json
Authorization: Basic api_key

Request Payload

{
  "startInDaysDelay": 1,
  "repetitionsCount": 5,
  "intervalInDays": 1,
  "packageId": "{packageId}"
}

For a complete description of each field, take a look at the JSON Properties section below.

Response Payload

{
    "startInDaysDelay": 1,
    "repetitionsCount": 5,
    "intervalInDays": 1,
    "reminders": [],
    "packageId": "{packageId}"
}

You will need to pass your package id as a parameter along with the settings that suits your requirement. The startInDaysDelay object allows you to wait a certain amount of days before sending the first reminder. This will not affect the initial notification sent the moment you sent your document package for signing. The intervalInDays object sets the frequency of your reminders. The repetitionsCount object sets the number of reminders OneSpan Sign will send to your signer(s), with a maximum of 5 reminders. Also. note that in order to set a reminder schedule, your package must be in DRAFT.

Similarly, once you’ve sent your document package for signing, you can update your reminder schedule by making a PUT request to the base URL with different parameters.

HTTP Request
PUT /api/packages/{packageId}/reminders

HTTP Headers
Accept: application/json
Content-Type: application/json
Authorization: Basic api_key

Request Payload

{
  "startInDaysDelay": 2,
  "repetitionsCount": 5,
  "intervalInDays": 3,
  "packageId": "{packageId}"
}

Response Payload

{
    "startInDaysDelay": 2,
    "repetitionsCount": 5,
    "intervalInDays": 3,
    "reminders": [],
    "packageId": "{packageId}"
}

You can retrieve your reminder schedule by making a GET request to the base URL. By doing so, you will also get all the reminders that have been sent to your signer(s). Below is an example JSON returned by OneSpan Sign.

HTTP Request
GET /api/packages/{packageId}/reminders

HTTP Headers
Accept: application/json
Content-Type: application/json
Authorization: Basic api_key

Response Payload

{
  "packageId": "ebfcf18f-7bbc-4ff6-a5db-6352dbbfa9f6",
  "startInDaysDelay": 2,
  "repetitionsCount": 5,
  "intervalInDays": 2,
  "reminders": [
    {
      "sentDate": "2016-02-26T00:30:02Z",
      "date": "2016-02-25T16:53:13Z"
    },
    {
      "sentDate": "2016-02-27T00:30:03Z",
      "date": "2016-02-26T16:53:13Z"
    },
    {
      "sentDate": "2016-02-28T00:30:01Z",
      "date": "2016-02-27T16:53:13Z"
    },
    {
      "sentDate": "2016-02-29T00:30:02Z",
      "date": "2016-02-28T16:53:13Z"
    },
    {
      "sentDate": null,
      "date": "2016-02-29T16:53:13Z"
    },
    {
      "sentDate": null,
      "date": "2016-03-01T16:53:13Z"
    }
  ]
}

To delete your reminder schedule, you make a DELETE request:

HTTP Request
DELETE /api/packages/{packageId}/reminders

HTTP Headers
Accept: application/json
Content-Type: application/json
Authorization: Basic api_key

Running Your Code

In this guide, a notification is sent to a signer once a day. Below is a screenshot of the notification emails received by the signer for a pending signature.

Notification Email

Get the Code

JSON Properties

Property Type Editable Required Default Sample Value(s)
startInDaysDelay integer Yes No n/a 1 / 2 / 3 …
repetitionsCount integer Yes No n/a 1 / 2 / 3 …
intervalInDays integer Yes No n/a 1 / 2 / 3 …
packageId string Yes No n/a 0ab0_b0jzotEqdXx9NJ-pzhJJ1c=

Reminder schedules enable a sender to choose how often to notify the signer(s) about a pending signature; in addition to the initial notification sent the moment the package (transaction in the UI) is sent for signing.
To notice, some of the code is an extension of the APEX SDK and can be gotten through this Code Share.

The Code

The function which allows you to add a Reminder Schedule to an existing package has been encapsulated like below:

public void createReminderScheduleForPackage(String packageId,Integer startInDaysDelay,Integer repetitionsCount,Integer intervalInDays)

You will need to pass your package ID as a parameter to the function, along with the settings that suits your requirement. Since you need a package ID to set your reminder schedule, you will need to do this AFTER you have created the package, but BEFORE you send it.

  • The startInDaysDelay parameter allows you to wait a certain amount of days before sending the first reminder. This will not affect the initial notification sent the moment your document package is sent for signing.
  • The intervalInDays parameter sets the frequency of your reminders.
  • The repetitionsCount parameter sets the number of reminders OneSpan Sign will send to your signer(s), with a maximum of 5 reminders.

Similarly, once you’ve sent your document package for signing, you can update your reminder schedule with different parameters and calling the function encapsulated like below:

public void updateReminderScheduleForPackage(String packageId,Integer startInDaysDelay,Integer repetitionsCount,Integer intervalInDays)

Note that reminders can be updated when package was in “SENT” status, while they can only be created in “DRAFT” status.

You can also retrieve your ReminderSchedule object by calling this encapsulated function:

public TestReminders.ReminderSchedule getReminderScheduleForPackage(String packageId)

By doing so, you will also get all the reminders that have been sent to your signer(s). Reminders are returned as a list.

TestReminders.ReminderSchedule reminderSchedule = getReminderScheduleForPackage(packageId);
List reminders = reminderSchedule.reminders;
for(TestReminders.Reminder reminder: reminders){
    	System.Debug('set date: ' + reminder.date_x + '; sent date: ' + reminder.sentDate);
}

To delete your reminder schedule, you likewise call this encapsulated function:

public void clearReminderScheduleForPackage(String packageId)

Running Your Code

You can execute this function in Execute Anonymous Window from Developer Console and type in:

new TestReminders().testReminders();

In this guide, a notification is sent to a signer once a day. Below is a screenshot of the notification emails received by the signer for a pending signature.
Capture

Included in this guide is the code that prints out the sent date of each reminder to the console. Below is a screenshot of what such an output would look like.
Capture

Get the Code