Notifications
6 min
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 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 docid\ jr7gxrh9ohbyvz1z b7bg action for invoking the function notification url per region region url us https //us east 1 api jigx com/v2 0/tool/organizations/{organizationid}/notifications https //us east 1 api jigx com/v2 0/tool/organizations/{organizationid}/notificationshttps //us east 1 api jigx com/v2 0/tool/organizations/{organizationid}/notifications https //us east 1 api jigx com/v2 0/tool/organizations/{organizationid}/notifications https //us east 1 api jigx com/v2 0/tool/organizations/{organizationid}/notifications https //us east 1 api jigx com/v2 0/tool/organizations/{organizationid}/notifications south east (e g australia) https //ap southeast 2 api jigx com/v2 0/tool/organizations/{organizationid}/notifications https //ap southeast 2 api jigx com/v2 0/tool/organizations/{organizationid}/notificationshttps //ap southeast 2 api jigx com/v2 0/tool/organizations/{organizationid}/notifications https //ap southeast 2 api jigx com/v2 0/tool/organizations/{organizationid}/notificationshttps //ap southeast 2 api jigx com/v2 0/tool/organizations/{organizationid}/notifications https //ap southeast 2 api jigx com/v2 0/tool/organizations/{organizationid}/notifications europe https //eu central 1 api jigx com/v2 0/tool/organizations/{organizationid}/notifications https //eu central 1 api jigx com/v2 0/tool/organizations/{organizationid}/notificationshttps //eu central 1 api jigx com/v2 0/tool/organizations/{organizationid}/notifications https //eu central 1 api jigx com/v2 0/tool/organizations/{organizationid}/notificationshttps //eu central 1 api jigx com/v2 0/tool/organizations/{organizationid}/notifications https //eu central 1 api jigx com/v2 0/tool/organizations/{organizationid}/notifications 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 =@ctx organization id click here to go there directly https //manage jigx com/settings/org details https //manage jigx com/organization/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 see the code sample in github https //github com/jigx com/jigx samples/blob/main/quickstart/jigx samples/jigs/guide notifications/basic/send submit form jigx send notification # 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 submit form jigx title send notification (submit form) icon alert circle type jig default actions \ children \ type action submit form options title send notification formid send form provider data provider rest method functioncall function send notification entity send notification onsuccess title message sent children \ type component form instanceid send form options children \ type component text field instanceid title options label title \ type component text field instanceid text options label text \ type component text field instanceid organizationid options label organizationid initialvalue =@ctx organization id ishidden true \ type component text field instanceid solutionid options label solutionid initialvalue =@ctx solution id ishidden true \ type component text field instanceid emails options label emails initialvalue =@ctx user email ishidden true \ type component text field instanceid accesstoken options label accesstoken initialvalue jigx ishidden true send notification with execute entity you can also send notifications using an execute entity docid\ jr7gxrh9ohbyvz1z b7bg 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 parameters are set in the execute entity action note that you don't have to use form fields as you could also assign all function parameters in the action itself notification sent with execute entity send notification jigx (function) # 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 execute entity jigx title send notification (execute entity) icon alert circle type jig default actions \ children \ type action execute entity options title send now provider data provider rest method functioncall entity send notification function send notification functionparameters deviceid jig organizationid =@ctx organization id solutionid =@ctx solution id emails =@ctx user email title =@ctx components title state value text =@ctx components text state value accesstoken jigx onsuccess title message sent children \ type component form instanceid send form options children \ type component text field instanceid title options label title \ type component text field instanceid text options label text 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 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 https //github com/jigx com/jigx samples/blob/main/quickstart/jigx samples/functions/notifications/send notification target jig jigx 1 send notification target jig jigx (function) # 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 2 view promotion details jigx (sending jig) title send notification (target jig) icon alert circle type jig default actions \ children \ type action execute entity options title send now provider data provider rest method functioncall entity send notification target jig function send notification target jig functionparameters deviceid jig organizationid =@ctx organization id emails =@ctx user email title 🎉 new product promotion text check it out now solutionid =@ctx solution id promotionid promo12345 jigid view promotion details accesstoken jigx onsuccess title message sent children \ type component form instanceid send form options children \ type component text field instanceid title options label title \ type component text field instanceid text options label text 3 view promotion details jigx (target jig) title promotion details icon zoom in type jig default datasources promotions type datasource static options data \ promotionid promo12345 name stylish teapot promo price 25 image https //picsum photos/id/225/500/300 children \ type component image options source uri =@ctx datasources promotions\[promotionid = @ctx jig inputs promotionid] image resizemode cover height 300 \ type component entity options children \ type component field row options children \ type component entity field options label promotion value =@ctx datasources promotions\[promotionid = @ctx jig inputs promotionid] name \ type component entity field options label promotion # value =@ctx jig inputs promotionid \ type component entity field options label price value text =@ctx datasources promotions\[promotionid = @ctx jig inputs promotionid] price format numberstyle currency currency usd sending push notifications using the jigx notification endpoint see external push notifications (api) docid\ fpw1wlliqmqazbh3zp2ci for more information and examples