2

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.

2 Answers 2

3

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.

5
  • I'm thinking of using this exact same approach for a similar need. Dman100 or @gorav - did either of you try this loop approach? Any gotchas to watch out for? Does it take a long time to send 20-50 emails?
    – mscholtz
    Commented Jun 24, 2017 at 1:30
  • 1
    Timing wise it sends immediately. I have not used flows to send emails outside of proof of concepts, I don't believe I have anything in production, so no other insights have I.
    – gorav
    Commented Jun 24, 2017 at 14:29
  • This was exactly what I'm looking for! I just can't seem to figure out how to set the recipient of the Email Alert via the Flow, it looks like I have to set it up on the Email Alert itself (which means i can't loop through the child records to set the recipient). Any advice?
    – user3515
    Commented Jun 20, 2018 at 15:53
  • the email alert is set for a specific object. you are looping over said object in your loop. so the recipient email should be set on the object itself, and that should work. does that make sense? is there a reason that wouldnt work for you?
    – gorav
    Commented Jun 20, 2018 at 17:56
  • Thanks for responding! I think that explains it - I was thinking that the email alert would be set up on the parent object, but if I set it up on the child object it should work. Will my template be able to pull in fields from the parent object? (Otherwise I can set up formula fields on the child object)
    – user3515
    Commented Jun 25, 2018 at 15:59
0

You might be able achieve this by Process Builder as you can traverse both ways which is parent to child and vice versa.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .