Notifications

You can send Notifications using Jigx Management or programmatically in your solutions, see Notifications. Notifications can be configured to be sent to a single user, the entire organization, users of a specific solution, and even users of a specific jig in a specific solution.

In-app & push notifications
In-app & push notifications

Configuration options

Core structure

function

Define a function in the Functions folder of your solution. The function has input parameters such as the notification title, the notification text and requires a Jigx accessToken or personal access token (PAT) .

jig

jigs will invoke the function for sending notifications either via submitting form values to the function or by using an execute-entity action for invoking the function.

Notification URL per region

Examples and code snippets

In the code examples below replace YOUR_ORG_ID with your actual Organization Id. You can find it in the Organization Settings section of the Jigx Management or use the expression [email protected].

Click here to go there directly: https://manage.jigx.com/settings/org-details

Notification sent when submitting a form

In this example we are using hidden form components (e.g. organizationId) to pass required parameters to the function. The emails field contains a comma-separated list of recipients. You could also use Expressions to create that comma-separated string dynamically at runtime.

Once you submitted the form, the recipients should receive both a push notification and an in-app notification. You can also check the delivery status of your notification in the Notifications section of the Jigx Management.

Add a function definition called send-notification.jigx to the functions folder of your solution and copy & paste the following snippet into it. Replace the {organizationId} in the url with your organization's Id.

Submit form to send notification
Submit form to send notification

See the code sample in GitHub.

# Add this file under the functions folder
provider: DATA_PROVIDER_REST
method: POST
url: https://us-east-1.api.jigx.com/v2.0/tool/organizations/{organizationId}/notifications
inputTransform: >-
  $.{
    "content": {
      "title":title,
      "text":text,
      "jigId":jigId,
      "screen":"jig" 
    },
    "scope":scope,
    "emails":emails,
    "description": "description",
    "solutionId": solutionId
  }
parameters:
  solutionId:
   type: string
   location: body
   required: false 
  jigId:
    type: string
    location: body
    required: false
    value: notification-form
  deviceId:
    location: body
    type: string
    required: true
    value: jig
  command:
    location: body
    type: string
    required: false
    value: createNotification
  organizationId:
    location: path
    type: string
    required: true
  scope:
    location: body
    type: string
    required: false
    value: USR
  emails:
    location: body
    type: array
    required: true
  title:
    location: body
    type: string
    required: true
  text:
    location: body
    type: string
    required: true
  accessToken:
    location: header
    type: jigx
    value: jigx
    required: true
  

Send notification with execute-entity

You can also send notifications using an execute-entity action if you want to have more control over what's being sent to the function.

In this example we are using state to access the two form fields title and text. All other function's parameters are set in the execute-entity action. Note that you don't have to use form fields as you could also assign all parameters in the action itself.

Notification sent with execute entity
Notification sent with execute entity
# Add this file under the functions folder
provider: DATA_PROVIDER_REST
method: POST
url: https://us-east-1.api.jigx.com/v2.0/tool/organizations/{organizationId}/notifications
inputTransform: >-
  $.{
    "content": {
      "title":title,
      "text":text,
      "jigId":jigId,
      "screen":"jig" 
    },
    "scope":scope,
    "emails":emails,
    "description": "description",
    "solutionId": solutionId
  }
parameters:
  solutionId:
   type: string
   location: body
   required: false 
  jigId:
    type: string
    location: body
    required: false
    value: notification-form
  deviceId:
    location: body
    type: string
    required: true
    value: jig
  command:
    location: body
    type: string
    required: false
    value: createNotification
  organizationId:
    location: path
    type: string
    required: true
  scope:
    location: body
    type: string
    required: false
    value: USR
  emails:
    location: body
    type: array
    required: true
  title:
    location: body
    type: string
    required: true
  text:
    location: body
    type: string
    required: true
  accessToken:
    location: header
    type: jigx
    value: jigx
    required: true
    

Send notification with a target jig with input parameters

You can also target a specific jig with input parameters from your push notification. An example of this would be a notification about a new product promotion with the promotion detail jig as the target. When the user taps on the notification (either on the native push notification or the in-app notification), the app will navigate to the specific promotion

Target a jig with a notification
Target a jig with a notification

For this, you need an adjusted REST function definition (see 1), a Jig that invokes the REST function (see 2), and a target jig that will be displayed when the user taps on the notification (see 3).

Replace the {organizationId} in the url with your organization's Id.

See the code sample in GitHub.

# Add this file under the functions folder
provider: DATA_PROVIDER_REST
method: POST
url: https://us-east-1.api.jigx.com/v2.0/tool/organizations/{organizationId}/notifications
inputTransform: >
  $.{
      "content": {
        "title": title,
        "text": text, 
        "screen": "jig",
        "jigId": jigId,
        "inputs":{
          "promotionId":promotionId
        }  
    },
      "scope": scope,
      "emails": emails,
      "solutionId": solutionId
  }
parameters:
  deviceId:
    location: body
    type: string
    required: true
    value: jig
  command:
    location: body
    type: string
    required: false
    value: createNotification
  organizationId:
    location: path
    type: string
    required: true
  scope:
    location: body
    type: string
    required: false
    value: USR
  emails:
    location: body
    type: array
    required: true
  title:
    location: body
    type: string
    required: true
  text:
    location: body
    type: string
    required: true
  promotionId:
    location: body
    type: string
    required: true
  solutionId:
    location: body
    type: string
    required: true
  jigId:
    location: body
    type: string
    required: true
  accessToken:
    location: header
    type: jigx
    value: jigx
    required: true
    

Sending push notifications using the Jigx notification Endpoint

See External push notifications (API) for more information and examples.

Last updated

Was this helpful?