Notifications

Last edit:  Jan 18, 2019

Contributors:  lemingos Slashek diana-lakatos

Notifications are messages sent to platformOS users (including admins) when something happens. A message can be an email, SMS, or programmatic call to a 3rd party API.

Notifications can be delayed, and you can use Liquid, GraphQL, and trigger conditions to decide if a notification should be sent. They are a powerful mechanism used for example to welcome new users, follow up after they've added their first item, or reach out to them if they have been inactive for a while.

Supported notification types

Currently, we support three types of notifications:

  • Email
  • SMS
  • API call

Notifications directory

All notifications are defined in the notifications directory.

Depending on what type of the notification you would like to define, you should have three subdirectories:

  • email_notifications: contains all email notifications
  • sms_notifications: contains all sms notifications
  • api_call_notifications: contains all API call notifications

Configuration

Each configuration can accept different properties, but some of the main concepts are common:

Property Description Default Example
to Depending on the alert type, it is either:
  • an email address of the recipient (or comma delimited list of emails)
  • mobile number of the recipient
  • endpoint for the API call
Accepts liquid.
n/a test@email.com
delay Number of minutes by which the notification should be delayed. You could use liquid to calculate the number. For example, one could easily schedule email to be sent the next day at 10 am Auckland time: {{ 'tomorrow 10am' | to_time: 'Pacific/Auckland' | number_of_minutes_until }} 0 2
enabled Boolean which defines whether alert should be invoked or not. If false, it will be simply ignored. true false
trigger_condition Liquid condition to control whether notification should be sent or not. The only value that allows notification to be delivered is true. If you skip it, the notification will be sent (unless enabled is false) true {% if should_send == 'some_value'%}true{% endif %} - this code will trigger the notification only if value of should_send is equal to 'some_value'.

Accessing form data from the notification

Wherever you have access to Liquid inside the notification, you can access data submitted in the form which triggered the notification using the form variable. Its structure mirrors the fields property of the associated FormConfiguration. When in doubt, you can always use to visualize the structure. If you would like to access properties, which are not included in the form variable, you should use a GraphQL query to fetch them. You can access the id of the resource associated with the submitted form via form.id.

Related topics