You need to sign in to do that
Don't have an account?
rdclk23
Send email from Apex using inner class and template?
I have an Apex class called GeoNearestAgent which at the end of processing, has a list variable containing multiple rows of data I want to email. At that point I create a SingleEmailMessage using a visual force email template and a component that references this apex class. When I run it I get no data in the email. Is the template controller reference creating another instance of the GeoNearestAgent class?
<apex:component controller="GeoNearestAgent" access="global">
<apex:dataTable value="{!Result}" var="pr" columns="3" border="1">
<apex:column >
<apex:facet name="header">Property</apex:facet>
{!pr.PropName}
</apex:column>
<apex:column >
<apex:facet name="header">Agent</apex:facet>
{!pr.AgentName}
</apex:column>
<apex:column >
<apex:facet name="header">Distance</apex:facet>
{!pr.Distance}
</apex:column>
</apex:dataTable>
</apex:component>
<apex:component controller="GeoNearestAgent" access="global">
<apex:dataTable value="{!Result}" var="pr" columns="3" border="1">
<apex:column >
<apex:facet name="header">Property</apex:facet>
{!pr.PropName}
</apex:column>
<apex:column >
<apex:facet name="header">Agent</apex:facet>
{!pr.AgentName}
</apex:column>
<apex:column >
<apex:facet name="header">Distance</apex:facet>
{!pr.Distance}
</apex:column>
</apex:dataTable>
</apex:component>
Peter_sfdc
It would be helpful if you would also post the code from your controller.