[SalesForce] Email all child records when parent is updated

Is it possible to use process builder and visual flow to send an email alert notification to all child records when the parent record is updated? I have a custom group object (parent) and member object (child). The child record has a lookup to the contact for the email address. When the group record is updated and meets a specific criteria, I want to send an email alert to all the child records. I know I can write a trigger to do this, but was curious if this might be possible to do using process builder and visual flow.

Best Answer

This is definitely possible, as long as the size of the group and number of daily emails is small enough to let you stay within flow and email limits (limits discussed in more detail at end)

There are different approaches, depending on if you want to send one mass email to all of them, or a single customized email to each recipient. I'll assume the latter.

Using flow, you would use a fast lookup to populate a sObject collection with all the child group records where parentID__c (whatever your relationship field is called) equals the Id of the parent that was updated.

Then, you would loop over the sObject collection, and send the email within the loop using the flow email alert element. I would create a standard email alert action, and use that, as your email will look better that if you tried to build it in the flow using the send email element, though that is a viable option for plain text emails. Using the email alert element, you should be able to use merge fields as you would in a workflow rule.

There are other ways to architect the flow but as long as your numbers are 'reasonable' it should definitely be feasible.

Limits

Here is some general info on flow limits.

I didnt see anything referencing flow email limits specifically, so it either falls into the apex email daily limits of 5,000 or the workflow email daily limits which are based on number of licenses and have a hard cap of 2M.

Regardless, the flow maximum number of executed elements at run time limit of 2000 would place a hard cap on the number of recipients at roughly 1,000 (depending on how many elements it takes in your loop to send the email, i think it should just be one).

So the daily limits would only come into play depending on how many parent records would get updated per day. My guess is that using the email alert action would use the workflow limits...but its just a guess. If anyone has some hard documentation on that that would be helpful.

Related Topic