You are on page 1of 1

Design Document for ITProjects-6649

Objective:
The objective is to automate the process of sending an email when an opportunity is set to "Closed
Won" in Salesforce. The email should be generated using an email template, with a Visualforce Email
Template attached.
Components:

 Trigger: An Apex trigger will be used to execute the necessary actions when an opportunity is
set to "Closed Won."
 Email Template: A pre-defined email template will be created to provide the body content of
the email.
 Visualforce Email Template: A Visualforce email template will be generated and attached to
the email.

Trigger Logic:

 Trigger Name: SendEmailOnOpportunityCloseWon


 Object: Opportunity
 Event: Before Update
 Condition: Check if the Opportunity's Stage is changed to "Closed Won"

Action Steps:

 Fetch the required data for the email from the related objects (e.g., Opportunity, Account,
etc.).
 Retrieve the Email Template that will be used for the email body.
 Attach the Visualforce Email Template to the email.
 Send the email to the relevant recipients.

You might also like