Recurring Notifications

Create notifications that automatically fire at an interval that you determine. When you want to turn them off just delete them using the provided ID.

Before You Start:

For this stack, Adastacks must store your your Adalo app ID and API key to complete each recurring notification. By using this endpoint, you are giving Adastacks permission to do this.

Your app must be published to the app stores in order for this stack to function. PWA's and web applications built in Adalo do not support native mobile push notifications.

Walkthrough

Setting Up the Actions

1. Login to Adastacks.com and navigate to your dashboard. (we'll need this for your API Key in a minute).

2. Open a new tab in your browser and open up your Adalo app in the Adalo editor

3. Once open, place a test button on a screen of your choosing

4. Under the "Click Actions" for the button, select +Add Actions, then choose Custom Action

5. Give your action a name, such as "Create Recurring Notification"

6. Select the Create option from the dropdown below the Title field, then click Next

7. The Base URL will be determined by what you want to accomplish - you can either Create recurring notifications or you can Delete them. Updating recurring notifications is not currently supported. First you must setup the Create Recurring Notifications action:

Create Recurring Notification URL

https://adastacks.app.n8n.cloud/webhook/create-recurring?app_id=APPID&adalo_key=ADALOKEY&to_email=TOUSEREMAIL&title=TITLE&body=BODY&starting_datetime=DATETIME&freq=FREQUENCY

8. Set the "Method" dropdown to POST

9. Add a query parameter called Content-Type with the value application/json

10. Add another query parameter called api_key with your Adastacks API Key as the value

11. Add Inputs to hold your data for the new Custom Action (You can name these whatever you like, but below are some suggestions).

Create Recurring Notification Inputs

Suggested Input Name
Input Type
Suggested Input Value

Adalo App ID

Text

For testing, you can make this anything you like, but should ideally be your Adalo app ID

Adalo API Key

Text

For testing, you can make this anything you like, but should ideally be your Adalo app's API Key

To User Email

Text

For testing, you can make this anything you like

Notification Title

Text

For testing, you can make this whatever you like

Notification Body

Text

For testing, you can make this whatever you like

Starting Datetime

Text

2022-12-19T23:24:30Z

Note that the date formatting when sending in the custom action should be No Formatting.

Frequency

Text

Allowed values are:

D for daily recurrence

W for weekly recurrence

M for monthly recurrence

Y for yearly recurrence

12. Replace the capitalized text in the URL with the Inputs you just made using the Magic Text button in the top right of the URL field.

13. Run the test request and copy the returned ID so you can setup the Delete action. (See the success screenshot below)

Even test actions that fail return a "Test Successful" message so be sure to click Show Full Response to ensure the action succeeded. This is by design so that you can still save the action and return to continue setting it up later if you wish.

Note that you should copy the returned ID from the Create Action when setting up the action. This is so that you can setup the Delete action using the generated ID.

14. Save the Custom Action. See below for an example custom action setup:

15. IMPORTANT! Don't forget to format the scheduled date to No Formatting by clicking the pencil icon. If you fail to do this, the notifications will not be sent.

16. Now let's create the Delete Recurring Notification action so that you can delete notifications when a user turns them off. Select the same test button you created in Step 3. This button is only for setting up the custom actions. Once the actions have been created and saved, you can delete this button.

17. Under the "Click Actions" for the button, select + Add Actions, then choose Custom Action

18. Give your action a name, such as "Delete Recurring Notification"

19. Select the Delete option from the dropdown below the Title field, then click Next

20. In the Base URL field of the custom action, copy and paste the following URL:

Delete Recurring Notification URL:

https://adastacks.app.n8n.cloud/webhook/delete-recurring?id=NOTIFICATIONID

21. Set the "Method" dropdown to POST

22. Add a query parameter called Content-Type with the value application/json

23. Add another query parameter called api_key with your Adastacks API Key as the value

24. Add the Input to hold your data for the new Custom Action (You can name this whatever you like, but below is a suggestion).

Delete Recurring Notifications Input

Suggested Input Name
Input Type
Suggested Input Value

Notification ID

Text

Use the generated ID from the Create Recurring Notification action you setup.

25. Replace the capitalized text in the URL with the Input you just made using the Magic Text button in the top right of the URL field.

26. Run the test request, then click Save Custom Action.

Even test actions that fail sometimes return a "Test Successful" message so be sure to click Show Full Response to ensure the action succeeded. This is by design so that you can still save the action and return to continue setting it up later if you wish.

Setting Up the Database Collection

Anytime you create a recurring notification, an ID is returned. You should save this ID to a collection in your Adalo database so that you can delete the notification if you need to. You can name this collection whatever you like - Notifications, Reminders, Events, etc.

All created notifications are stored outside of Adalo and will run indefinitely until you delete them with the Delete endpoint. You must maintain a collection of notification IDs in order to delete notifications.

Anytime you create a recurring notification with the Custom Action, you should also Create a notification in your Notifications collection. At the very least, you should have these properties in your collection:

Property Name
Property Type
Description

ID

Text

The is the ID returned by the Create Recurring Notification action.

Creator

Relationship - One User to Many Notifications

This is the creator of the notification.

Notification Title

Text

This is the title of the saved notification

Notification Body

Text

This is the body of the saved notification

Action Setup

Your Create actions might look something like this:

Example App

If you still need help, you can always check out this cloneable app to see how you might build out your screens, database, and actions. If you need additional help, please see one of the many support channels Adastacks has available.

Last updated