I am creating a plugin that sends a Slack message to a user when triggered by a webhook from a third party system when the system is experiencing service outages. The plugin is configured with a webhook trigger and uses a compound action in its body. The compound action has a user_email input argument to find the recipient to send the Slack message to, along with a message template that parses some of the information from the webhook’s payload. In my testing, I am sending a mock webhook payload via curl command and providing an email address of a user to send the Slack message to, but the actual payload from the third party system does not include email addresses/user information. Instead of sending the Slack message to just a single user, I’d like to send it to either all Slack users (which Moveworks has ingested), or a group of users, for example that are identified through an email distribution list that use the third party system.
Is there a way to accomplish this so the plugin can send messages to all users, or a group of users, without inputting individual email addresses within the compound action? Since the plugin is using a webhook trigger, the plugin’s audience settings are not able to be configured like we see with a conversational trigger. If the plugin had the capability to configure audience settings I believe I could have the message sent to all users or a group of users.
Here is a snippet of the compound action code I am currently using to send the Slack message to the targeted user.
steps:
- action:
action_name: mw.get_user_by_email
output_key: target_user
input_args:
user_email: data.user_email
- notify:
output_key: notification_output
recipient_id: data.target_user.user.id
message:
RENDER():
...Thank you!