Salesforce provides the feature of sending emails pertaining to records when the triggering criteria is met. However, the complexity lies mostly in defining the triggering criteria to ensure that duplicate mails are prevented and that the criterias do not overlap one another.
Email alert flow:
- Send email template A – when the opportunity is first created
- Send email template B – when the opportunity is modified
- Send email template C – when the opportunity reaches closed won stage
Most common error due to overlap of criteria:
- User updates the opportunity to closed won + update some fields at the same time
Error: Email template B and C are sent out
Expected result: Send email template C only
A combination of workflow rule and workflow actions are use to:
- Identify the stages of the criteria and what constitutes a new, updated, final opportunity and implement as the workflow rule criteria
- Prevent continuous loop by selecting the correct evaluation criteria.
- The above common error can be resolved by using a rule criteria based on the definition gathered from #1. Hence, send email template B – when opportunity is modified but not in closed won stage.
|Components||Workflow Rule, Workflow Action, Email Templates|