Set the recipient's dynamically in email notification

damodharan1
Tera Contributor

Hi All,
We had an existing notification when the record is inserted or updated in Requested Item(sc_req_item).

we have a use case to send this notification to different user  based on the condition,So we have used email script and tried many ways to set "To" person  like email.setReplyTo("person mail id") or email.addAddress("to",personemail,personname)  

 

Please help me to resolve this issue and thanks in advance.

 

Note: We can not change the notification setting to send when "Event is fired" and write a Business rule.

 

 

3 REPLIES 3

Mark Manders
Mega Patron

Why can't you write a BR to have an event take care of this? 

Have you tried using the send notification in a flow, to validate the condition in there?


Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark

Hi Mark,
    We have many notifications for this use case, so writing BR/Creating a flow is an alternative approach and we are planning to re-use these existing notifications to ensure older functionality is not breaking.

 

Thanks,

You want to change these notifications to be set dynamically, so you are already changing the older functionality. If that's just because of the content, why not make it an email template that is used in the old notification and in the new? You can't override the old functionality with new on the same notification and have it work in both ways, but differently. It can very well be that I am missing something. 

From the flow action 'send notification' you can also select an existing notification to be send, but that will still send it to the predefined recipients, or you make it dynamically, based on the conditions in the flow (same as an event and a BR), but it's still not clear why that's not possible.


Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark