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.
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?
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.