SMS Notification

 

SMS Notification

SMS Notification allows users to be notified by SMS (text messages). This is an add on feature in OneVizion that can be added by an Administrator. This feature is made possible by deploying an integration (smsnotification) to the https://onevizion.atlassian.net/wiki/spaces/USER/pages/279642117 and by using Amazon SNS Service. The integration deployed is responsible for periodically processing the notification queue and pushing the notifications that are assigned to smsnotification as text messages by using Amazon SNS service.

Setup

In order to setup SMS Notification, below steps need to be followed:

1. Setup an AWS Account

Customers need to setup or have credentials of an AWS SNS Account. This will be the account from which the text messages will be sent. There will be additional costs associated with this.

  1. Log into AWS console

  2. Create an IAM policy using SNSPublishSMSOnly.json

  3. Create an IAM user and store credentials

  4. Attach this new profile to the user

2. Setup Field for Phone Number in User Trackor Type

OneVizion Administrator will need to setup a field that will store the Phone Number for the user who will receive the notification. This field should be added to a User Trackor Type. Phone numbers should be stored with country code in this field. Examples are +1(999)888-1234 and 19998881234. Data Validation can be used to ensure the entered value is in this format

3. Setup an Integration Account in OneVizion

OneVizion Administrator will need to setup a dedicated account for running the integration. The integration account will need below privileges. Make sure you validate the account's credentials by logging in.

  1. WEB_SERVICES R

  2. ADMIN_NOTIF_QUEUE RE

  3. ADMIN_USERS R

  4. ADMIN_INTEGRATION_LOG RA

  5. <User Trackor Type> R (discussed in step #2 above)

  6. <User Trackor Type Tab containing phoneNumberField> R (discussed in step #2 above)

4. Create Notification Service

OneVizion Administrator will create a notification service from Admin Center->System Administration->Services page. Make sure the Service has a Name, ‘is Enabled’ and type ‘Notification’. Other values from this panel are not applicable as they will be obtained from the settings file in Integration.

5. Deploy and Configure Integration:

OneVizion Administrator will add an Integration to the Dev Center->Integration Hub page. Repository URL should point to https://github.com/ov-integrations/sms-notification . When user clicks Save/Apply on this panel, the default values will get loaded.

The sms-notification integration that gets deployed should be configured by setting values in the settings.json file as follows:

  1. oneVizionUrl - OneVizion URL

  2. oneVizionLogin - OneVizion Login (created in step #3 above)

  3. oneVizionPwd - OneVizion Password (created in step #3 above)

  4. serviceId - ID of the Notification Service (created in step #4 above)

  5. phoneNumberField - The name of the field which contains the phone number of the recipient. The recipient is a user trackor related with User ID from the Notif Queue record. (created in step #2 above)

  6. awsAccessKeyId - AWS Access Key ID (created in step #1 above)

  7. awsSecretAccessKey - AWS Secret Access Key (created in step #1 above)

  8. maxAttempts - The number of attempts to send SMS

  9. nextAttemptDelay - The delay in seconds before the next SMS sending after an unsuccessful attempt

  10. awsRegion - AWS Region. (defaults to us-east-1, which is one of the SMS enabled regions in AWS)

6. Create Notification Template

Users and Administrators can now create a Notification template (from Dev Center->Build Applications ->Notification Page). All Notifications that point to ‘SMS Notification’ as Notif Service will be delivered as text messages. The ‘SMS Notification’ service was configured in step #4 above.

 

Investigating Issues

Below are a few things Administrators can check on if Text Messages are not being received.

Integration Runs: Is the Integration service running?

Select the smsnotification record in the Integration Hub grid and click on the ‘Integration Run’ icon that opens near the Edit button. This will open a grid that shows all the runs of the current integration. The ‘Schedule’ configured in step#5 dictates the frequency in which the integration runs. The default is set to run every five minutes. There should be an entry in this panel every 5 minutes. If you don't see any entries here, contact OneVizion Support to make sure your integration service is running.

Clicking on the Status link (Executed with Errors) will provide more details. In the screenshot below, you can see that the Integration failed to run because of invalid credentials in the settings.json file.

 

Integration Logs: Check for errors Integration Run

For successful, Integration Runs (Status - Executed without Errors), the logs pertaining to that run can be accessed by selecting the run record and clicking on the ‘Integration Log’ icon .

In the screenshot below, you can see that the Phone number is not available in the User trackor.

 

Notification Queues: Is my notification being sent?

Administrators can access the Notification Queue page from Admin Center → Audits Logs menu. By filtering/searching on ‘Notif Service’, we can see the Queue Status and Error Message of the individual notifications. In the screenshot below, few SMS Notifications have failed as the user(s) had no phone number specified.