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

Visualforce template does not have a controller that can be selected for preview

Good morning,

I created a Visualforce email template using "User" object as my recipienttype and "Lead" object as my relatedToType, but when trying to test the window doesn't display the test record field to select but rather states "Visualforce template does not have a controller that can be selected for preview" and gives only the option to send myself a test email without being able to attach a record to use for the test (what's being tested is how the record details is displayed).

Email Template is as follows: 

<messaging:emailTemplate subject="New lead assigned to you: {!relatedto.Name} for Partner Company: <b>{!relatedto.Partner_Company__c}</b>" recipientType="User" relatedToType="Lead">
<messaging:htmlEmailBody >

The following lead has been assigned to you:<p/>
Company:  {!relatedto.Company} <p/>
Lead Name:  {!relatedto.Name} <p/>
<apex:outputLink value="{!}">Click here to view record</apex:outputLink><p/>


Seems pretty basic, and i've deployed several other emails before, but this is the first occurance of this message on testing. Does anyone know what may be the culprit?

Yes, They do not have controler directly but if we use component ( along with Controller) then we can perform flexible solutions over VF template.

Sandeep Singhal