ASPSMS notification

Prerequisites

git checkout origin/osp-communications-configuration .
git checkout origin/osp-reports-configuration .

Description

In this tutorial you will learn to :

  • Configure an sms provider

  • Configure the notification

  • Configure an output and the contact

Structure

@startuml
skinparam backgroundColor transparent
package "modules" as modules {
    node communication as "osp-communications"
    node report as "osp-reports"
}

package "root" as root {
package "providerSMS" as provider {
    [providers.coms] as provComs
    [value.ospp] as valueSMS
}

package "directory" as contact {
    [contacts.coms] as contacts
}

package "notification" as notification {
    [notification.coms] as notif
    [output.coms] as output
package "template" as templates {
    [template.ftl] as templateftl
    [template.ospp] as templateProperty
    [template.reports] as templateReports
}
}
    [dashboard.view] as dash
}

report -[#blue]-> templateReports : **Own**
templateReports -[#blue]-> templateftl : **Own**

communication -[#blue]-> provComs : **Own**
communication -[#blue]-> contacts : **Own**
communication -[#blue]-> notif : **Own**
valueSMS -[#black]-> dash : **Give provider status**
output -[#red]-> notif : **Trigger**

notif -[#black]-> templateReports : **Use**
notif -[#black]-> provComs : **Use**

output -[#black]-> contacts : **Use**
@enduml

Steps

1. Configure the ASPSMS provider

root/providerSMS/provider.coms

{
    "moduleId": "modules.communications.communications-1",
    "providerType": "ASPSMS",
    "username": "${YOUR_USERNAME}",
    "passwordProvider": {
        "type": "PLAINTEXT",
        "password": "${YOUR_PASSWORD}"
    }
}

root/providerSMS/value.ospp

{
    "name": "ASPSMS Provider Value",
    "description": "",
    "type": "BOOLEAN"
}

2. Create the notification with the template

root/notification/notification.coms

{
  "moduleId": "modules.communications.communications-1",
  "template": {
    "shortMessageTemplateId": "root.notification.short"
  },
  "accessedValues": []
}

root/notification/short/template.ospp

{
    "description": "",
    "format": "plain",
    "name": ""
}

root/notification/short/template.reports

{
    "moduleId": "modules.reports.reports-1",
    "baseTemplatePath": "root/notification/short/template.ftl"
}

root/notification/short/template.ftl

Change on ${trigger["name"]}

3. Create the output and the contact

root/notification/output.coms

{
  "notificationId": "root.notification",
  "targets": [
    {
      "originator": {
        "smsSender": "OnSphere"
      },
      "providers": [
        {
          "providerId": "root.providerSMS"
        }
      ],
      "recipient": {
        "type": "FROM_STATIC_LIST",
        "contactsId": "root.directory"
      }
    }
  ]
}

root/directory/contacts.coms

{
    "moduleId": [
        "modules.communications.communications-1"
    ],
    "contacts": [
        {
            "type": "PERSONAL",
            "firstname": "Bob",
            "lastname": "Morane",
            "email": "bob.morane@localhost",
            "number": "0791234567"
        },
        {
            "type": "PERSONAL",
            "firstname": "Titi",
            "lastname": "Minet",
            "email": "titi.minet@localhost",
            "number": "0791234567"
        },
        {
            "type": "PERSONAL",
            "firstname": "Code",
            "lastname": "Lyoko",
            "email": "code.lyoko@localhost",
            "number": "0791234567"
        }
    ]
}