โ12-18-2023 11:10 AM
best practice question....
I'm creating recipe triggered by SFDC Opportunity that will create Sales orders in ERP and compare in SFDC op and set to booked won etc... this is working pretty cool.
my very last step is to send an email to users involved... the thought is:
Account Owner, Opportunity Owner, Opportunity Created by , Order manager Prime, Order manager (actually processing PO in case prime is on vacation or something)
what's the best way to find the email address? looking up each one seems to eat up some tasks so wasn't sure if I needed to add a custom filed onto the SFDC Op to include all the different emails I might want to use or if that's overkill.
Solved! Go to Solution.
โ12-18-2023 11:50 AM - edited โ12-18-2023 11:51 AM
I've done it different ways in different situations, so I wouldn't say there's a best practice.
If there's value in creating the field upstream and exposing it in the UI so people know who is getting notified, then create it there. If nobody is going to see the field in the UI, it might be better to construct it directly in the recipe.
If you're concerned about task usage, you can concatenate this directly in the input field for the email action. You shouldn't need to do it in a separate task. (I don't know how the data is structured so I'm making some assumptions, but it's almost certainly possible.)
โ12-18-2023 11:18 AM - edited โ12-18-2023 11:19 AM
Is the question how to find the emails, or how to get them all into a single input?
I'm not sure how the data is structured, but if they are all strings of single emails I would suggest making a static array, like this:
[ (acccount owner pill), (opp owner pill), (opp created by pill), (etc...) ].uniq.smart_join(',')
If they are already in an array, there are probably cleaner ways to do this.
(I added a .uniq above because some email services throw errors if you provide two instances of the same address.)
โ12-18-2023 11:41 AM
yes I guess I wasn't that clear... my question is as follows:
I have all these names in the data pill but do I use a task to go and get the email address out of the user object or is it best to create a field at the opportunity level to store these email addresses so I wouldn't have to use any tasks since I already have the opportunity pil.
In theory I could create a text formula field in the SFDC opportunity and concatenate all these email addresses into this field and just use this field
โ12-18-2023 11:50 AM - edited โ12-18-2023 11:51 AM
I've done it different ways in different situations, so I wouldn't say there's a best practice.
If there's value in creating the field upstream and exposing it in the UI so people know who is getting notified, then create it there. If nobody is going to see the field in the UI, it might be better to construct it directly in the recipe.
If you're concerned about task usage, you can concatenate this directly in the input field for the email action. You shouldn't need to do it in a separate task. (I don't know how the data is structured so I'm making some assumptions, but it's almost certainly possible.)