+ Start a Discussion
amidstcloudamidstcloud 

Internal Error in creating a VF Email template....

Hi All,

 

I need to send a VF page as attachment ..  VF page is rendering as PDF... I can not use getcontent and GetcontentasPDF, as I need to schedule this mail on every monday .  ..So I create a VF template... but I getting  a Salesfroce Internal error after I save my tempalte .  .  

 

Template code.....

 

<messaging:emailTemplate subject="Test email" recipientType="Contact" >
<messaging:plainTextEmailBody >
Please find the attachment....
</messaging:plainTextEmailBody>
<messaging:attachment filename="Velocity Trade Confirmation" renderAs="PDF">
<apex:include pageName="reportspage"/>
</messaging:attachment>
</messaging:emailTemplate>

 

 

this a simple page where i am showing any 10 accounts...

 

<apex:page renderAs="pdf" controller="fetchtestdata">
<apex:repeat var="acc" value="{!acc_lst}">
<apex:outputLabel value="{!acc.name}"></apex:outputLabel><br/>
</apex:repeat>

</apex:page>

 

Controller....

 

public class fetchtestdata {
public list <account> acc_lst {get{
return([select name from account limit 10]);
}

set;}

}

 

Please provide your sugesstions.. . thanks .. 

ForceMantis (Amit Jain)ForceMantis (Amit Jain)

Try removing renderas pdf from page and just keep in email template attachment tag.