+ Start a Discussion
Salesforce seekarSalesforce seekar 

Trigger Requirement ,

Requirement on trigger -- my requirement is if we change the opportunity stage  to "CLosed won" , 
 based on email address present in  Contact role in  opportunity line item  we need to send an automatic reply email to that email address  .
 can any one share sample code or give us idea how to write this trigger.
Best Answer chosen by Salesforce seekar
SonamSonam (Salesforce Developers) 
What you can do is - create a field that copies the email of the primary contact of the opportunity into a opp field and then send out a workflow email alert to the email when opp is closed won.

Read through the thread to get sample code:
https://developer.salesforce.com/forums?id=906F00000008wKzIAI