User Story
As a Salesforce Admin,
I want to automatically send an email to the Primary Contact of an Account when the Opportunity stage is updated,
So that the contact is kept informed with relevant, stage-specific communication.
Acceptance Criteria
-
Email Templates:
- 9 Lightning Email Templates are created, each corresponding to an Opportunity stage.
- Templates are systematically named (e.g.,
Template_Prospecting
, Template_Qualification
) for easy mapping.
-
Trigger Conditions:
- When an Opportunity’s stage is updated, an email is sent to the Primary Contact of the related Account.
- The correct email template must be used based on the updated stage.
-
Recipient Logic:
- The email is sent to the Primary Contact of the Account linked to the Opportunity.
- If no Primary Contact exists, no email is sent, and an error is logged.
-
Dynamic Fields:
- Each email template must include dynamic Opportunity and Account fields (e.g., Opportunity Name, Stage, Account Name).