Package: Messaging Tools

Author: HCA Central
Version: 2
Added to Library: 10-Nov-23
HCAVersion needed: 18.0.5
Keywords: Utility

Requirements: You must configure messaging for this to be useful.

Package Description:
Single program in your design that handles all message sending based upon priority

Program: Send Message

Program Description:
For maintainability, you should have a single program in your design that uses messaging. This program lets you control messaging from only a single location. Places that now uses a messaging program element can now start this program with a start-program element.

Why have a single program to do messaging? Makes it easier to modify later. Perhaps introduce a specific subject prefix into all messages, perhaps implement a different priority level scheme, add or remove other message receipients.

Program has 5 parameters but with defaults you really only need 1

P1: Message text

P2: Priority (possible values 1, 2, or 3, default is "2")

P3: Email action: (possible values 0, 1, 2 - default is "0")

P4: SMS action: (possible values 0, 1, 2 - default is "0")

P5: Message subject

Priority

1 = email and SMS regardless of time of day

2 = email and SMS during OK SMS hours

3 = email only

Email action

0 = Normal action as defined by the priority

1 = Always send email. Overrides normal priority action.

2 = Never send email. Overrides normal priority action.

SMS action

0 = Normal action as defined by the priority

1 = Always send SMS. Overrides normal priority action.

2 = Never send SMS. Overrides normal priority action.

This program has one tag "OK SMS Hours" and a default value of value of "8:00,21:00". The idea is you don't want to get text messages in the middle of the night unless they are high priority.

Return value: rc = 0 means all went well and the message sent

rc <> 0 means problem sending message

Parameters:

Name Type Description Default
Text Value Message text to send  
Priority Value 1,2,3 - 1=Email and SMS 24/7. 2=Email and SMS during OK hours. 3=Email only 2
EmailAction Value 0,1,2 - 0=According to priority. 1=always send email. 2=never send email. 0
SMSAction Value 0,1,2 - 0=According to priority. 1=always send SMS. 2=never send SMS. 0
Subject Value Message Subject for email Message from HCA