I am trying to create a VisualForce Email Template, in this emailTemplate i need to get value from Custom Objects.(This Object is not related to Any other Objects - This is the Object Which i am storing the Configuration values)
Below are the Apex Class, Controller, and VF Email Template. I am Receiving the empty data email.
APEX:
public class getSiteURL {
private Configure__c config;
public string getSiteURL() {
config = [select Configuration_Value__c from Configure__c where Configuration_Type__c LIKE 'Site URL'];
return config.PSAS__Configuration_Value__c;
}
}
VF Components -- siteURLComponents
<apex:component controller="getSiteURL" access="global">
</apex:component>
VisualForce Email Template
<messaging:emailTemplate subject="test" recipientType="Contact" relatedToType="Family__c">
<messaging:htmlEmailBody >
<html>
<body>
<b><u>URL:</u></b>
<br />
<c:siteURLComponents/>
</body>
</html>
</messaging:htmlEmailBody>
</messaging:emailTemplate>