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
MWelch_WTMWelch_WT 

Variables in Visualforce Email Template controllers?

I'd like to run a SOQL query based on a list of IDs somehow passed in to a VF email template controller. Something like this:

 

 

Opportunity Opps=[select Name from Opportunity where id in :IDList];

 


Problem is, I can't figure out how to pass in that previously populated IDList. The end goal here is to allow the customer to select a bunch of Opportunities about which to send some emails, while at the same time giving him the ability to modify the template to his liking.

 

Any input? 

jkucerajkucera
That looks right:

public static void Opps(ID oppID){ List<ID> IDList = new List<ID>(); IDList.add(oppID); Opportunity Opps=[select Name from Opportunity where id in :IDList]; }