Business Case:
A recruitment company would like to use Salesforce as their application tracking system to be able to better manage job applications and stay on top of the candidate pipeline. One of the requirements was to automatically send interview confirmation emails based on a record trigger.
Tool Used:
Flow Builder
Problem:
During the development of the given user story, the developers raised the concern of not being able to test the email delivery on record creation.
Steps taken to Resolve:
Development team took the following steps in order below trying to resolve it:
- Changed Email Deliverability Access level to “All Email”.
- Created an Email Relay to route the outgoing emails via company’s domain
- Tested the flow by sending emails to company’s inbox as well as private email addresses with domains such as Gmail, Hotmail, outlook etc
- Changed the flow slightly by adding a filter which checks for email address field to be populated
Whilst the steps above added value, they did not solve the main problem. We ended up opening a case with Salesforce requesting their email deliverability team to help. Salesforce support spent about 4 days looking into it , on the 4th day they recommended creating a DKIM key which may help with delivering the emails. Again, whilst there is a good reason why the DKIM key should be created, it did not help with email getting delivered.
We also looked at email logs and it turned out that emails were not even sent from Salesforce.
The actual Solution:
After looking at the email logs, I decided to create a brand new flow thinking to test one step at a time to find the root cause. I tried keeping it as simple as possible. The flow was set to trigger when a record is created or updated with a condition that the email address is not null. This flow worked instantly without error. I then went back to the original flow drilling down at every step from the beginning and found the root cause of the problem.
The flow which was causing trouble had an Entry Condition in place which was checking if the status picklist value had been changed. Offcourse the status at the time of record creation is only getting populated rather than changed. This was making the records to not even enter the flow and go to the first step let alone send an email. Sometimes it’s the smallest things which can get easily ignored but cause the most trouble.
When troubleshooting, the key is to always break down the process into little steps so you can test each and every step individually and see where the problem actually occurs.