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
Hi Akshayg,What type of value are you passing to toemailaddress()?Did you try that expression separately with the same input? Si it returning valid email addresses?try that expression separately and make sure it is returning valid email addresses.
I had used like this but it was throwing error "no valid recipients resolved"...so was trying different way to solve ... Can you tell what change should i make..
Hi Karthik ... that rule is working fine and returning value.. But for some location Say B don't have Email Address for M3 and M4 ..for that am using XOR gate
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...