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
AnunimmalaAnunimmala 

VIsualforce Email Template

Hi Everyone,

 

 I have a question with Visualforce EmailTemplate creation.I have created a Visualforce EmailTemplate which sends a csv file as an attachment to user.So For passing a customlist to Csv file i used a component which uses a controller to call a custom list and iam using apex:repeat to display the list in the component .Finally am caaling this component in my visualforce email template </messaging:attachment> tag .So my file is attached as csv but csv file not looking good .It has a break line after each record in csv.How can i eliminate this.

 

My code for componet and visualforce emailtemplate. as follows.

 

<apex:component controller="ControllerVisualforceEmailTemplate" access="global" >
Order Item Name,OrderNumber
<apex:repeat var="orderItem" value="{!listOrderItems}" >

{!orderItem.Name},{!orderItem.Case__r.CaseNumber}
</apex:repeat>

</apex:component>



<messaging:emailTemplate recipientType="Contact"
relatedToType="Account"
subject="Your account's cases"
replyTo="nimmala.anukarthi@gmail.com"  >
<messaging:htmlEmailBody >

<c:componentVisualforceEmailTemplate />

</messaging:htmlEmailBody>
<messaging:attachment renderas="pdf" filename="cases.pdf">


<c:componentVisualforceEmailTemplate />

</messaging:attachment>
<messaging:attachment filename="cases.csv"  >

<c:componentVisualforceEmailTemplate />
</messaging:attachment>
</messaging:emailTemplate>
_Prasu__Prasu_

Problem may be in the component you have written. I dont find any issue in the Template.