[this post is a continuation to the dynamic status post found here]
Notifications will need an update for status - currently we have notifications that trigger against a date (-15,-10, etc) and in certain cases when a status changes (audit completed). Since you will be able to define your own status, it makes sense that you are able to define a new “Warning” notification on every section (and this is important s today warning notifications do not exist on every section) where dynamic status exist.
The user can choose “Dynamic Status Notification” from the first drop down and then on a second drop down they can choose the dynamic status that will be triggered from the list of configured dynamic status.
Warning: users CAN NOT delete dynamic status if they have a configured notification.
On top of this we want to expand all notifications (not just dynamic) to include webhooks not just emails, for this we’ll need to update the current modal for notifications to include Webhooks, we basically need one more tab on the notification engine called that way.
To define a webhook we need the following information:
- Method (POST by default)
- EndPoint URL (must be a valid URL)
- Headers (this is an paragraph field where user defines http headers one line below the other)
- Payload (same as above)
- Timeout (by default 5 seconds) … this is important because if the end-point is unresponsive the cron job will get stuck with this process for sure as many notifications could have been configured.
Note: Payload and Headers can use macros, in the same way notification uses them.
We need a “Test” button , when pressed by the user we open a popup with the http response received by the definition set above.
Is important that when the notifications triggers we store records just as we do with notifications, this is important for debug purposes. today we send emails to a email queue (which in the end stores records so users can tell what happened when), we need to re-use this magic for webhooks.
Under description we need to log the call as it was triggered and the response.