I need to send mail to multiple people based on selected location..
lets say: I need to send mail to people based on selected location.
There are multiple location (A,B,C,D)
There mail needs to be sent to 4 people: (M1,M2,M3,M4).
If i select Location A then a mail should be triggered to that location only and all 4 people should receive mail for that particular location.
Can someone help with the logic
Discussion posts and replies are publicly visible
Create an expression rule where you pass in the location ID of your choice, and possibly any other identifying information, and as an output, returns the email addresses for the desired target audience. This would just be an array of text where each member is an email address, and you probably need to wrap it in the toEmailAddress() function for it to play nice with the Send Email node (i've never been sure why). Then you just set the "To:" field in the Send Email node with that expression rule.
Hi Mike i have used your logic but am getting below Error
I'm unable to tell what the issue might be since you haven't shared what value(s) your expressions are producing. In the previous screenshot you would need to show us what the in-process value of "pv!sendTo" was. In the newer screenshot, what is the output of the 'AER_getEmail()` expression rule when you provide realistic test data like what you'd get in a running process? And is there a reason you don't put the "toEmailAddress()" rule inside the expression rule itself?
Well the Expression AER_getEmail() based on location iD am fetching the mail Address . Do refer this screen shot and have used toemailAddress inside rule still am getting same error as above
But I'm asking you to confirm what output you get when you run that rule in the Expression Rule Editor. Just as before I have no way of confirming whether the value you're passing into the TO: field would be valid without seeing an actual example of the resulting value you're passing into it.
i wish i could share that information...
You should be prepared to show test data or at least redacted data if you're hoping to find help here with issues like this, since we can't just guess as to what values you're trying to pass into the email node.
Even if you can't share a screenshot of test data, sharing the expression for rule!AER_getEmail() would be helpful for us to help you troubleshoot.
rule!AER_getEmail()-- am trying to fetch email based on locationId
From your screenshot I still can't really judge whether we'd expect this expression rule to give valid output (i.e. a single valid email address or an array of string where each entry is a valid email address).
Anyway thanks mike will check with internal team then, if someone can help me out
Yeah I would say this needs to be run by someone with authorization to see the output of that rule, because from the error message you posted earlier it looks as if (at least in the instance where you go the error, if not all instances) no valid email addresses are being output.