Added email groups and changed notif-profiles to selectively send to groups. #175
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We had the desire to send some alerts (such as disk 80% full) only to admins, and send other alerts (such as API is down) to admins and customers. This has be achieved by changing the email Receivers in the Key/Value store from a JSON Array to a Folder with nested Keys that represent email groups, and values that are Lists of receivers for the given group. For example:
...
receivers/
admins --> ["[email protected]", "[email protected]"],
customers --> ["[email protected]", "[email protected]"]
...
The code was updated to handle this different Key/Value setup, with the majority of the changes being the email-notifier needing to filter messages before sending. Basically, the existing Notify function was wrapped in a loop that goes through the email groups. In order to keep the wrapped code from getting difficult to read, the Notify function was broken into a few smaller functions.