TransWikia.com

How do we set up Flow to automatically email a subset of contacts when an Opportunity changes stages?

Salesforce Asked by EricB on November 8, 2021

We are trying to do something that seems pretty simple – when an opportunity changes stages we want to automatically send an email to a subset of related contacts. That subset is any related contact that has the Role of "Partner". According to SFDC Admin Assist, the email notification feature in Salesforce can only email ALL the related contacts, and cannot filter for specific roles. However, they did say that a Flow would solve the issue (but creating the Flow itself is out of scope for them).

Example of what we need:

  • Situation: Opportunity A has 3 related contacts – Jill (CEO), John (COO), Sam (Partner), and Alex (Partner)
  • Trigger: Opportunity A moves from Stage 1 to Stage 2
  • Result: We want to automatically send an email to Sam and Alex but not Jill or John

Can anyone help get us on the right path?

One Answer

You can achieve this by using a combination of Process Builder and an Autolaunched Flow.

If the Opportunity Stage is changed, call the Autolaunched Flow from the Process Builder passing the Opportunity Id. (Declare Opportunity_Id as an input variable in flow).

enter image description here

enter image description here

In flow, query for Contacts related to the Opportunity and having Role as 'Partner' (I have created a lookup on Contact to Opportunity and a custom field 'Role' on Contact. You can change these based on your requirements.)

Loop through the queried Contacts, add their email addresses in a flow text collection variable.

Add the Core Action element Send Email and pass the Email Addresses collection variable.

enter image description here

enter image description here

enter image description here

enter image description here

enter image description here

enter image description here

Answered by Prakhar Saxena on November 8, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP