Overview
The below document explains the steps needs to be configured for sending notifications to all users of accounts, using announcements.
How It works
* Create a Group email alias for each account, such that sending mail to this group email will notify all the users of that account.
* We will configure this group email alias as an additional field of Account inside the MSP application.
* Now when an announcement is raised with a set of affected accounts, The group email alias configured for these accounts will be notified individually with the content of the announcement.
Implementation
To achieve this requirement, we will be using the following functionalities in our product.
DB trigger
Global functions
Callback Custom Functions
(I) DB Trigger configuration.
To configure DB trigger, add the following entries in the mentioned xml,
1.Edit [MSP_HOME]\conf\OperationHandler.xml and add following entries
<Script module="Announcement" output="ANNOUNCEID" table="Announcement" command="announcement_notification.txt"/>
py triggernotification.py $id announcements
(II) Global functions
Configure the following global functions.
Function 1
Function Name - Get Configuration
Return type - Map
API Name - getconfiguration
Function definition CodeFunction 2
Function Name - Get Entity Details
Return type - Map
API Name - getentity
Parameters
entityid=int
entity=string
Function 3
Function Name - Get notify emails for Accounts
Return type - String
API Name - getnotifyemailsforaccounts
Parameters -
account=Map
Function definition Code -Function 4
Function Name - Send Mail for Account additional field configured emails
Return type - void
API Name - sendmailforaccountemails
Parameters -
accountsjson=Map
messagecontent=String
subject=String
Function definition Code -
Once the above Global functions are defined, configure the Custom call back function as below.
Function Name - Send Mail to Accounts
Return type - void
API Name - sendemailtoaccountcallback
Publish - True
Parameters -
moduleid=int
module=String
Function definition Code -