[SalesForce] Pass link to a visualforce page in Visualforce email template

Can we pass link to a visualforce page in a Visualforce email template.
I have been successful in passing a link to a object.

<messaging:emailTemplate subject="Sample: Test" recipientType="User" relatedToType="Account"><messaging:htmlEmailBody ><apex:outputText value{!LEFT($Api.Partner_Server_URL_140,FIND('.com',$Api.Partner_Server_URL_140+4)+relatedTo.Id}"></apex:outputText></messaging:htmlEmailBody></messaging:emailTemplate>

Best Answer

You can try the same concept with Visualforce page I believe

 <messaging:emailTemplate subject="Sample: Test" recipientType="User" relatedToType="Account">
   <messaging:htmlEmailBody >
    <apex:outputLink value="{!LEFT($Api.Partner_Server_URL_140,FIND('.com',$Api.Partner_Server_URL_140)+4)+'apex/VisualforceName?id='+relatedTo.Id}">
      <apex:outputtext value="{!LEFT($Api.Partner_Server_URL_140,FIND('.com',$Api.Partner_Server_URL_140)+4)+'apex/VisualforceName?id='+relatedTo.Id}"/>
   </apex:outputLink>
  </messaging:htmlEmailBody>
</messaging:emailTemplate>

Instead of record Id may be use /apex/Vfname?id=id