Send Email Alerts to Different Recipients Based on Condition

I’m wondering if it is possible to send an watcher event to a specific individual depending on a certain attribute/condition.

For example, if condition A is met from a watcher send alert to individual A. If conditon B is met send alert to individual B but not to A

Hey,

two ways to solve this:

First, you can use conditions within actions, so one easy way to build this, is just to add two email actions, each with a condition. Each condition contains a different recipient. This would however mean, that you have to copy the JSON that creates the email into both of these actions.

Alternatively you could also just put the recipient in a variable (i.e. with a script transform) and then use "to": "{{recipient_variable}}" in your single email action.

Hoep this helps.

--Alex

Hey Alex,

Appreciate the feedback! I wasn't able to find any conditions within action examples, so I started to think this wasn't possible. For the second way, I'm assuming the condition would update the variable?

I'll see if I can make it happen.

thanks!

indeed. you can set own variables within the condition like ctx.foo = 'bar' or have an own condition section within the action.

--Alex

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.