I've tried to schedule a recurring email but it seems the "salesRepID" parameter is not receiving the value from the "ToID" assignment because the proper records aren't being retrieved in the query at the controller level. The query works without the "salesRepID" parameter.
my VF template:
<messaging:emailTemplate subject="Reminder: Inactive Opportunity Reminder for {!Relatedto.Name}" recipientType="User" relatedToType="User">
<messaging:htmlEmailBody >
<p>The following leads have not yet been updated:</p>
<c:Digilant_InactiveLeads ToID="{!RelatedTo.ID}" />
<p>To update these leads, click on the "Lead Status" field located in the upper right on the lead page layout.</p>
</messaging:htmlEmailBody>
</messaging:emailTemplate>
my controller:
public class Digilant_findInactiveLeads {
public List<Lead> leads {get; set;}
public ID salesRepID {get; set;}
public Digilant_findInactiveLeads() {
leads = [select Name, LeadSource, CreatedDate from Lead from Lead where status = 'Open' AND ownerId =: salesRepID];
}
public List<Lead> getInactiveLeads() {
return leads;
}
}
my component:
<apex:component controller="Digilant_findInactiveLeads" access="global">
<apex:attribute name="ToID" type="ID" description="the lead owner ID" assignTo="{!salesRepID}"/>
<apex:dataTable value="{!InactiveLeads}" var="i_lead">
<apex:column >
<apex:facet name="header">Name</apex:facet>
{!i_lead.Name}
</apex:column>
<apex:column >
<apex:facet name="header">Source</apex:facet>
{!i_lead.LeadSource}
</apex:column>
<apex:column >
<apex:facet name="header">Created Date</apex:facet>
{!i_lead.CreatedDate}
</apex:column>
</apex:dataTable>
</apex:component>
If anyone wants to give pointers on how to watch variables I'd appreciate that as well. I'm trying to RTFM now.