Send Emails to the Assigned Profile Users with Flow (Salesforce)
ฝัง
- เผยแพร่เมื่อ 19 พ.ย. 2024
- #salesforce #salesforceadmin #flow
In this episode, learn how to send emails to users assigned to specific profiles.
⚙️ Steps:
Start by selecting a trigger that is going to fire the emails. See what are you trying to monitor on records, for example, field info changing.
Create a record triggered Flow (setup - flow - new)
Select the target object and set condition requirements
Get records (users). Set condition to match user profile ID with Salesforce profile ID. Store all matched users records in the collection variable (3rd radio button - choose fields and assign variables).
Create a record collection variable with data type 'Record'. This is where you are going to store user records.
Add logic (Loop) and loop through each user record related to the profile. In this loop we are using the record collection variable from the previous step.
Add Email Action and create email Body and Subject. For Subject use Plain Text formatting or you will get 'paragraph angle brackets' in the email subject.
Select a sender. This can be the user triggering the record OR go to "Organization-Wide Addresses". Create the Org Default email address.
Then in your Flow, Specify the Org default email in the sender address and OrgWideEmailAddress as the sender type (*this extra step isn't covered in the video)
Save/Debug/Activate/Test!
🔔 Subscribe to Salesforce Atlas!
✏️ Take Salesforce Admin Practice Tests or share with your SF friends/colleagues: www.udemy.com/...
🎵 Music: You by Ikson ( / ikson )
I have been stuck on this for quiet some time! thank you so much for breaking everything down!
Hi Kyla, awesome so great you found it useful!
Very Useful & Informative video.
Very useful flow, thanks for sharing!
Thank you, Dan!
Super Useful. Thanks a lot!!!!!!!!!!!
thank you 😊😊😊 more help from your video....thanks again
Thanks Shubham! 😊
Thank you for this
Thanks a lot !!!
This is very much helpful....
Thank you! 😊
This helped a lot. I didn't realize you could build the email template in the Flow.
Awesome to hear! Flow is a great tool worth looking into it more 😊
Beautiful! Thanks
Thanks, Richard!
Hello, thank you for the tutorial, I found it easy to follow. One question is the email notice that gets send out has the html tags, how can we remove that? Thank you!
Hi Olympiya, thank you! It should be somewhere in the video. In the email action, you need to switch on/enable rich text. For subject line, you can use plain text template or manually remove if they pop up.
Hi Dorisa, thanks for sharing. Worked perfectly fine for me. Just a question: all emails are sent out from my address. Would it be possible to set up a general address or an alias and how ?
Thanks
Hi Romain, yes its possible. You will need to look into OrgWideEmailAddress -a verified global email address for your organization. Try it
Eh never a good idea to hardcode Id's though. Some Id's do change across orgs. Anyone trying this should use the GET RECORDS and use some other method, like the profile type, etc. Otherwise perfectly sound straight forward tutorial. Wasn't exactly what I needed right now, but just wanted to offer some extra advice to anyone watching.
Thanks, appreciate your feedback. Yes, I won't be showing any copied over IDs and will stick to good practice
Hardcoding Profile Ids (or Ids) is not a good practice. Instead, you should use the GET RECORDS element to search for the Profile object WHERE Name = System Admin, then use the ProfileId from that in the GET RECORDS for the User object.
Names of profiles are far less likely to change between orgs, so keep your query as "dynamic" as possible by searching the name
Also, you are able to dynamically pull a specific org's URL, instead of, again, hardcoding the org's URL in the email hyperlink. Yes, this video shows a possible solution to solving this problem, but it is not the best solution because of all the hardcoding.
Hi Nate, appreciate your feedback! That makes sense. If someone is creating a solution in a sandbox, then the name most likely will be the same in prod, whereas IDs must be changed. I agree and going to look into creating another video. Thanks!