You need to sign in to do that
Don't have an account?
BrianWK
Visualforce Email Controller Extension or Email Visualforce page as body and not Attachment
Hello everyone.
I've successfully created my first page that required a custom controller extension. Thanks to everyone who help me fumbled through it.
I have a current page on a custom object (Implementation__c) with a extension containing SOQL to build a list of related objects (Implementation_Issue__c). The Implementation_Issue__c is a standard object with a look up to Implementation__c, a detail object with a master to Account.
The page works perfectly. Originally, I had planned on Rendering the page as PDF and attaching the PDF to an email to our clients. It has been requested that the page becomes the body of the email and not an attachment.
I'm struggling here, it doesn't appear I can use <Apex:page> within a visualforce email template. So I'm not sure how can I call the controller extension for my relatedto:Implementation__c object.
Anyone have an idea how I can accomplish this? My thoughts are:
1. Somehow call my Implementation__c extension within the email template (not sure how or if I can do this)
2. Change the Implementation__c extension to by an extension for the email template (<messaging:emailTemplate> ?)
3. Keep my extension and page as is, but use code to set it as an email (not sure if this is possible either)
Again, my goal is to use this page as the body of the email and not as an attachment. I haven't been able to see how to call a custom controller or an extension within an Visualforce Email template, or what the controller for an email template is to create a new extension to give me the functionality I need.
Any help, suggestions are most welcomed!
Having a similar issue!
I guess we need to know the equivalent structure to:
for VS email templates.
If you find an answer, let me know!
To create a custom component check the link below;
https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_comp_cust_elements_controllers.htm
The custom component should look like this in visualforce email
<messaging:htmlEmailBody >
<c:CustomComponent customRecordId="{!relatedTo.Id}"></c:FSProjects>
</messaging:htmlEmailBody >