function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
gporrogporro 

Sending an email from an Opportunity object

Hello

 

Each time we create an opportunity, we create a task/activity, to send a Thank You email to the primary contact Role from the Client Account

 

I do have a VisualForce template <messaging:emailTemplate recipientType="Contact"
    relatedToType="Opportunity"

 

How can I populate the "TO" information with my Contact when I hit the "Send Email" button on the Opportunity record?

 

I created an APEX Class that pulls the primary Contact ID, but not sure how I can put that contact in context so that my Recepient will be properly set

 

Thanks

Giorgio