• Vishal Biraris
  • NEWBIE
  • 25 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 5
    Questions
  • 12
    Replies
Hello,

I am not able to get values of standard as well as Custom object fields used in my code (Code is provided below) in email,
I can see the values when i run using "Send test and verify merge fields" option within "Visualforce Email Template"

Currently I am triggering the template from the "Process Builder"

I am only getting Text from below visualforce code but not the values.

My code is :-


<messaging:emailTemplate subject="First payment reminder - Customer id : {!relatedTo.Exact_Online_Account_ID__c}" recipientType="Contact" relatedToType="Account" >

<messaging:htmlEmailBody >
    <STYLE type="text/css">
        TH {font-size: 11px; font-face: arial;background: #CCCCCC; border-width: 1;  text-align: center }
        TD  {font-size: 11px; font-face: verdana }
        TABLE {border: solid #CCCCCC; border-width: 1}
        TR {border: solid #CCCCCC; border-width: 1}
     </STYLE>
     <font size="2" face="Lucida Sans Unicode">

<font size="2" face="Lucida Sans Unicode" > Dear  {!relatedTo.Name}, </font><br/>
<br/>

<font size="2" face="Lucida Sans Unicode" >Our financial records show that we have not yet received funds for your subscription for the total amount {!relatedTo.Total_Outstanding_Amount__c}&nbsp;{!relatedTo.CurrencyIsoCode}</font><br/>
<br/>
<font size="2" face="Lucida Sans Unicode" >We kindly ask you to pay each individual invoice using transfer of funds to our bank account within 5 business days of receiving this email.</font><br/>

<br/>
<font size="2" face="Lucida Sans Unicode" >Your outstanding invoices:</font><br/>

<br/>
        <table border="0" > 
            <tr>
                <th align="right"><font size="2" face="Lucida Sans Unicode" >Invoice Number   ;</font><br/></th>
                <th align="right"><font size="2" face="Lucida Sans Unicode" >Payment Due Date   ;</font><br/></th>
                <th align="right"><font size="2" face="Lucida Sans Unicode" >Payment Due Since   ;</font><br/></th>
                <th align="right"><font size="2" face="Lucida Sans Unicode" >Amount Due   ;</font><br/></th>
                <th align="right"><font size="2" face="Lucida Sans Unicode" >Currency   ;</font><br/></th>
                
            </tr>
            
            <apex:repeat var="cx" value="{!relatedTo.Invoices__r}" >
            
                <apex:outputPanel rendered="{! If(cx.Outstanding_Amount_FC__c > 0,true,false) }">
                <apex:outputPanel rendered="{! If(cx.Receivable_Is_Fully_Paid_del__c == 'false',true,false) }">

                   <tr>
                        <td align="right"><font size="2" face="Lucida Sans Unicode" >{!cx.Invoice_Number__c}&nbsp;</font></td>
                        
                        <td align="right"><font size="2" face="Lucida Sans Unicode" >
                            <apex:outputText value="{0,date,dd'/'MMM'/'yyyy}">
                                <apex:param value="{!cx.Transaction_Due_Date_del__c}" /> 
                            </apex:outputText>&nbsp;</font>
                        </td>

                        <td align="right"><font size="2" face="Lucida Sans Unicode" >{!TEXT(cx.Total_Due_Days__c)}&nbsp; Days </font></td>

                        <td align="right"><font size="2" face="Lucida Sans Unicode">&nbsp;
                            <apex:outputText style="float:right" value="{0, number, ###,##0.00}">
                                <apex:param value="{!cx.Outstanding_Amount_FC__c}"/>
                            </apex:outputText>&nbsp;</font>
                        </td>
                        
                        <td align="right"><font size="2" face="Lucida Sans Unicode" >{!cx.Currency__c}&nbsp;</font></td>
                                                                        
                   </tr>
            
                </apex:outputPanel>   
                </apex:outputPanel>                 
                                  
            </apex:repeat>
        </table>  
     </font>
                    
<br/>

<font size="2" face="Lucida Sans Unicode" >Our bank details</font><br/>
<font size="2" face="Lucida Sans Unicode" >Payment reference :- {!relatedTo.Exact_Online_Account_ID__c} </font><br/>
<font size="2" face="Lucida Sans Unicode" >Please do not hesitate to contact us with questions. Thank you in advance for your cooperation. </font><br/>


<br/>
<br/>
<br/>  
                
<font size="2" face="Lucida Sans Unicode" >Best regards,</font><br/>
<font size="2" face="Lucida Sans Unicode" >Collection department</font><br/>
<font size="2" face="Lucida Sans Unicode" >BV Amsterdam, the Netherlands</font><br/>
                
</messaging:htmlEmailBody>
</messaging:emailTemplate>
Hello all,

As per below visualforce email template code, it's selecting all the Invoices of custom object "Invoices" into my email.
I would like to filter the invoice records based on the INVOICE object field "Receivable_Is_Fully_Paid_del__c",
That means i would like to select the Invoice records into email only when "Receivable_Is_Fully_Paid_del__c" field has value "false" AND "Outstanding_Amount_FC__c" field has value greater than 0.

Could you please help me on how we can add filter to handle this situation.

May be somethins i need to change on this line "  <apex:repeat var="cx" value="{!relatedTo.Invoices__r}" >" of below code , but not sure wha exactly need to change.


My Visualforce working code is - 

<messaging:emailTemplate subject="First payment reminder" recipientType="Contact" relatedToType="Account">

<!-- <messaging:plainTextEmailBody >
Congratulations!
This is your new Visualforce Email Template.
</messaging:plainTextEmailBody> -->

<messaging:htmlEmailBody >
    <STYLE type="text/css">
        TH {font-size: 11px; font-face: arial;background: #CCCCCC; border-width: 1;  text-align: center }
        TD  {font-size: 11px; font-face: verdana }
        TABLE {border: solid #CCCCCC; border-width: 1}
        TR {border: solid #CCCCCC; border-width: 1}
     </STYLE>
     <font face="arial" size="2">

<font size="2" face="Lucida Sans Unicode" > Dear  {!relatedTo.Name}, </font><br/>
<br/>

<font size="2" face="Lucida Sans Unicode" >Our financial records show that -- subscription for the total amount {!relatedTo.CurrencyIsoCode}&nbsp;{!relatedTo.Total_Outstanding_Amount__c} </font><br/>
<br/>


 
<br/>
        <table border="0" > 
            <tr>
                <th align="right"><font size="2" face="Lucida Sans Unicode" >Invoice Number   ;</font><br/></th>
                <th align="right"><font size="2" face="Lucida Sans Unicode" >Payment Due Date   ;</font><br/></th>
                <th align="right"><font size="2" face="Lucida Sans Unicode" >Amount Due   ;</font><br/></th>
                <th align="right"><font size="2" face="Lucida Sans Unicode" >Currency   ;</font><br/></th>
                
            </tr>
            
            <apex:repeat var="cx" value="{!relatedTo.Invoices__r}" >

               <tr>
                        <td align="right"><font size="2" face="Lucida Sans Unicode" >{!cx.Invoice_Number__c}&nbsp;</font></td>
                        
                        <td align="right"><font size="2" face="Lucida Sans Unicode" >
                            <apex:outputText value="{0,date,dd'/'MMM'/'yyyy}">
                                <apex:param value="{!cx.Transaction_Due_Date_del__c}" /> 
                            </apex:outputText>&nbsp;</font>
                        </td>


                        <td align="right"><font size="2" face="Lucida Sans Unicode">&nbsp;
                            <apex:outputText style="float:right" value="{0, number, ###,##0.00}">
                                <apex:param value="{!cx.Outstanding_Amount_FC__c}"/>
                            </apex:outputText>&nbsp;</font>
                        </td>
                        
                        <td align="right"><font size="2" face="Lucida Sans Unicode" >{!cx.Currency__c}&nbsp;</font></td>
                                                                        
               </tr>
                                   
            </apex:repeat>
        </table>  
     </font>
                    
<br/>

<font size="2" face="Lucida Sans Unicode" >Our bank details:</font><br/>
<font size="2" face="Lucida Sans Unicode" >Payment reference: {!relatedTo.Exact_Online_Account_ID__c} </font><br/>
<font size="2" face="Lucida Sans Unicode" >Please do not hesitate to contact us with questions. Thank you in advance for your cooperation. </font><br/>

<br/>
<br/>
<br/>  
                
<font size="2" face="Lucida Sans Unicode" >Best regards,</font><br/>
<font size="2" face="Lucida Sans Unicode" >Collection department</font><br/>
<font size="2" face="Lucida Sans Unicode" >BV Amsterdam, the Netherlands</font><br/>
                
</messaging:htmlEmailBody>
</messaging:emailTemplate>
Hello all,

We would like to change the subject ""First payment reminder" " as mentioned in below sample visulaforce code, based on the some condtions.
That means, If i send first reminder email then i am going to update the field "Total remider sent" value to 1,
Then later after checking other due dates conditions, ww would like to send another email but with different Subject i.e ". "Second payment reminder" and again update Total remider sent" value to 2.
can you please help how to handle such situation, This will help me to reuse same template for all the reminder;s, Invoice information will be picked up on run time, so no issues with that.


My Visualforce working code is - 

<messaging:emailTemplate subject="First payment reminder" recipientType="Contact" relatedToType="Account">

<!-- <messaging:plainTextEmailBody >
Congratulations!
This is your new Visualforce Email Template.
</messaging:plainTextEmailBody> -->

<messaging:htmlEmailBody >
    <STYLE type="text/css">
        TH {font-size: 11px; font-face: arial;background: #CCCCCC; border-width: 1;  text-align: center }
        TD  {font-size: 11px; font-face: verdana }
        TABLE {border: solid #CCCCCC; border-width: 1}
        TR {border: solid #CCCCCC; border-width: 1}
     </STYLE>
     <font face="arial" size="2">

<font size="2" face="Lucida Sans Unicode" > Dear  {!relatedTo.Name}, </font><br/>
<br/>

<font size="2" face="Lucida Sans Unicode" >Our financial records show that -- subscription for the total amount {!relatedTo.CurrencyIsoCode}&nbsp;{!relatedTo.Total_Outstanding_Amount__c} </font><br/>
<br/>


 
<br/>
        <table border="0" > 
            <tr>
                <th align="right"><font size="2" face="Lucida Sans Unicode" >Invoice Number   ;</font><br/></th>
                <th align="right"><font size="2" face="Lucida Sans Unicode" >Payment Due Date   ;</font><br/></th>
                <th align="right"><font size="2" face="Lucida Sans Unicode" >Amount Due   ;</font><br/></th>
                <th align="right"><font size="2" face="Lucida Sans Unicode" >Currency   ;</font><br/></th>
                
            </tr>
            
            <apex:repeat var="cx" value="{!relatedTo.Invoices__r}" >

               <tr>
                        <td align="right"><font size="2" face="Lucida Sans Unicode" >{!cx.Invoice_Number__c}&nbsp;</font></td>
                        
                        <td align="right"><font size="2" face="Lucida Sans Unicode" >
                            <apex:outputText value="{0,date,dd'/'MMM'/'yyyy}">
                                <apex:param value="{!cx.Transaction_Due_Date_del__c}" /> 
                            </apex:outputText>&nbsp;</font>
                        </td>


                        <td align="right"><font size="2" face="Lucida Sans Unicode">&nbsp;
                            <apex:outputText style="float:right" value="{0, number, ###,##0.00}">
                                <apex:param value="{!cx.Outstanding_Amount_FC__c}"/>
                            </apex:outputText>&nbsp;</font>
                        </td>
                        
                        <td align="right"><font size="2" face="Lucida Sans Unicode" >{!cx.Currency__c}&nbsp;</font></td>
                                                                        
               </tr>
                                   
            </apex:repeat>
        </table>  
     </font>
                    
<br/>

<font size="2" face="Lucida Sans Unicode" >Our bank details:</font><br/>
<font size="2" face="Lucida Sans Unicode" >Payment reference: {!relatedTo.Exact_Online_Account_ID__c} </font><br/>
<font size="2" face="Lucida Sans Unicode" >Please do not hesitate to contact us with questions. Thank you in advance for your cooperation. </font><br/>

<br/>
<br/>
<br/>  
                
<font size="2" face="Lucida Sans Unicode" >Best regards,</font><br/>
<font size="2" face="Lucida Sans Unicode" >Collection department</font><br/>
<font size="2" face="Lucida Sans Unicode" >BV Amsterdam, the Netherlands</font><br/>
                
</messaging:htmlEmailBody>
</messaging:emailTemplate>
Hello,

I need to send visualforce email address to the Address mentioned on Account's custom field "Billing_E_Mail__c"
Could you please suggest what changes are required in below code ?

My Visualforce working code is - 

<messaging:emailTemplate subject="First payment reminder" recipientType="Contact" relatedToType="Account">

<!-- <messaging:plainTextEmailBody >
Congratulations!
This is your new Visualforce Email Template.
</messaging:plainTextEmailBody> -->

<messaging:htmlEmailBody >
    <STYLE type="text/css">
        TH {font-size: 11px; font-face: arial;background: #CCCCCC; border-width: 1;  text-align: center }
        TD  {font-size: 11px; font-face: verdana }
        TABLE {border: solid #CCCCCC; border-width: 1}
        TR {border: solid #CCCCCC; border-width: 1}
     </STYLE>
     <font face="arial" size="2">

<font size="2" face="Lucida Sans Unicode" > Dear  {!relatedTo.Name}, </font><br/>
<br/>

<font size="2" face="Lucida Sans Unicode" >Our financial records show that -- subscription for the total amount {!relatedTo.CurrencyIsoCode}&nbsp;{!relatedTo.Total_Outstanding_Amount__c} </font><br/>
<br/>


 
<br/>
        <table border="0" > 
            <tr>
                <th align="right"><font size="2" face="Lucida Sans Unicode" >Invoice Number   ;</font><br/></th>
                <th align="right"><font size="2" face="Lucida Sans Unicode" >Payment Due Date   ;</font><br/></th>
                <th align="right"><font size="2" face="Lucida Sans Unicode" >Amount Due   ;</font><br/></th>
                <th align="right"><font size="2" face="Lucida Sans Unicode" >Currency   ;</font><br/></th>
                
            </tr>
            
            <apex:repeat var="cx" value="{!relatedTo.Invoices__r}" >

               <tr>
                        <td align="right"><font size="2" face="Lucida Sans Unicode" >{!cx.Invoice_Number__c}&nbsp;</font></td>
                        
                        <td align="right"><font size="2" face="Lucida Sans Unicode" >
                            <apex:outputText value="{0,date,dd'/'MMM'/'yyyy}">
                                <apex:param value="{!cx.Transaction_Due_Date_del__c}" /> 
                            </apex:outputText>&nbsp;</font>
                        </td>


                        <td align="right"><font size="2" face="Lucida Sans Unicode">&nbsp;
                            <apex:outputText style="float:right" value="{0, number, ###,##0.00}">
                                <apex:param value="{!cx.Outstanding_Amount_FC__c}"/>
                            </apex:outputText>&nbsp;</font>
                        </td>
                        
                        <td align="right"><font size="2" face="Lucida Sans Unicode" >{!cx.Currency__c}&nbsp;</font></td>
                                                                        
               </tr>
                                   
            </apex:repeat>
        </table>  
     </font>
                    
<br/>

<font size="2" face="Lucida Sans Unicode" >Our bank details:</font><br/>
<font size="2" face="Lucida Sans Unicode" >Payment reference: {!relatedTo.Exact_Online_Account_ID__c} </font><br/>
<font size="2" face="Lucida Sans Unicode" >Please do not hesitate to contact us with questions. Thank you in advance for your cooperation. </font><br/>

<br/>
<br/>
<br/>  
                
<font size="2" face="Lucida Sans Unicode" >Best regards,</font><br/>
<font size="2" face="Lucida Sans Unicode" >Collection department</font><br/>
<font size="2" face="Lucida Sans Unicode" >BV Amsterdam, the Netherlands</font><br/>
                
</messaging:htmlEmailBody>
</messaging:emailTemplate>
Hi all,I am trying to create VF email template. I have account object and inside account I have custom object "Invoices", I need help how we can get "Invoices” object fields into template.

My sample code is –
Messaging:emailTemplate subject="Dunning Reminder" recipientType="Contact" relatedToType="Invoice__c">
<!-- <messaging:plainTextEmailBody >
Congratulations!
This is your new Visualforce Email Template.
</messaging:plainTextEmailBody> -->
 
<messaging:htmlEmailBody >
<b> Dear  {!relatedTo.Name} </b><br/>
Our financial records show that we have not yet received funds for your Virtuagym subscription for the total amount of currency_and_total_amount. <br/>
        <table>
            <tr>
                <th>Invoice Number</th>
            </tr>
           
            <apex:repeat var="cx" value="{!relatedTo.Account_invoice__r}" >
               <tr>
                        <td>{!cx.Invoice_Number__c}</td>
               </tr>
                                   
            </apex:repeat>
        </table>                        
 
I am also getting error – “Error: Invalid field Invoice_Number__r for SObject Account”
Additional Info :-
- Invoice__c : Is API name of my Custom Object Invoices
- Account_invoice__c - Child Relationship Name of Invoices with Accounts
Hello,

I am not able to get values of standard as well as Custom object fields used in my code (Code is provided below) in email,
I can see the values when i run using "Send test and verify merge fields" option within "Visualforce Email Template"

Currently I am triggering the template from the "Process Builder"

I am only getting Text from below visualforce code but not the values.

My code is :-


<messaging:emailTemplate subject="First payment reminder - Customer id : {!relatedTo.Exact_Online_Account_ID__c}" recipientType="Contact" relatedToType="Account" >

<messaging:htmlEmailBody >
    <STYLE type="text/css">
        TH {font-size: 11px; font-face: arial;background: #CCCCCC; border-width: 1;  text-align: center }
        TD  {font-size: 11px; font-face: verdana }
        TABLE {border: solid #CCCCCC; border-width: 1}
        TR {border: solid #CCCCCC; border-width: 1}
     </STYLE>
     <font size="2" face="Lucida Sans Unicode">

<font size="2" face="Lucida Sans Unicode" > Dear  {!relatedTo.Name}, </font><br/>
<br/>

<font size="2" face="Lucida Sans Unicode" >Our financial records show that we have not yet received funds for your subscription for the total amount {!relatedTo.Total_Outstanding_Amount__c}&nbsp;{!relatedTo.CurrencyIsoCode}</font><br/>
<br/>
<font size="2" face="Lucida Sans Unicode" >We kindly ask you to pay each individual invoice using transfer of funds to our bank account within 5 business days of receiving this email.</font><br/>

<br/>
<font size="2" face="Lucida Sans Unicode" >Your outstanding invoices:</font><br/>

<br/>
        <table border="0" > 
            <tr>
                <th align="right"><font size="2" face="Lucida Sans Unicode" >Invoice Number   ;</font><br/></th>
                <th align="right"><font size="2" face="Lucida Sans Unicode" >Payment Due Date   ;</font><br/></th>
                <th align="right"><font size="2" face="Lucida Sans Unicode" >Payment Due Since   ;</font><br/></th>
                <th align="right"><font size="2" face="Lucida Sans Unicode" >Amount Due   ;</font><br/></th>
                <th align="right"><font size="2" face="Lucida Sans Unicode" >Currency   ;</font><br/></th>
                
            </tr>
            
            <apex:repeat var="cx" value="{!relatedTo.Invoices__r}" >
            
                <apex:outputPanel rendered="{! If(cx.Outstanding_Amount_FC__c > 0,true,false) }">
                <apex:outputPanel rendered="{! If(cx.Receivable_Is_Fully_Paid_del__c == 'false',true,false) }">

                   <tr>
                        <td align="right"><font size="2" face="Lucida Sans Unicode" >{!cx.Invoice_Number__c}&nbsp;</font></td>
                        
                        <td align="right"><font size="2" face="Lucida Sans Unicode" >
                            <apex:outputText value="{0,date,dd'/'MMM'/'yyyy}">
                                <apex:param value="{!cx.Transaction_Due_Date_del__c}" /> 
                            </apex:outputText>&nbsp;</font>
                        </td>

                        <td align="right"><font size="2" face="Lucida Sans Unicode" >{!TEXT(cx.Total_Due_Days__c)}&nbsp; Days </font></td>

                        <td align="right"><font size="2" face="Lucida Sans Unicode">&nbsp;
                            <apex:outputText style="float:right" value="{0, number, ###,##0.00}">
                                <apex:param value="{!cx.Outstanding_Amount_FC__c}"/>
                            </apex:outputText>&nbsp;</font>
                        </td>
                        
                        <td align="right"><font size="2" face="Lucida Sans Unicode" >{!cx.Currency__c}&nbsp;</font></td>
                                                                        
                   </tr>
            
                </apex:outputPanel>   
                </apex:outputPanel>                 
                                  
            </apex:repeat>
        </table>  
     </font>
                    
<br/>

<font size="2" face="Lucida Sans Unicode" >Our bank details</font><br/>
<font size="2" face="Lucida Sans Unicode" >Payment reference :- {!relatedTo.Exact_Online_Account_ID__c} </font><br/>
<font size="2" face="Lucida Sans Unicode" >Please do not hesitate to contact us with questions. Thank you in advance for your cooperation. </font><br/>


<br/>
<br/>
<br/>  
                
<font size="2" face="Lucida Sans Unicode" >Best regards,</font><br/>
<font size="2" face="Lucida Sans Unicode" >Collection department</font><br/>
<font size="2" face="Lucida Sans Unicode" >BV Amsterdam, the Netherlands</font><br/>
                
</messaging:htmlEmailBody>
</messaging:emailTemplate>
Hello all,

As per below visualforce email template code, it's selecting all the Invoices of custom object "Invoices" into my email.
I would like to filter the invoice records based on the INVOICE object field "Receivable_Is_Fully_Paid_del__c",
That means i would like to select the Invoice records into email only when "Receivable_Is_Fully_Paid_del__c" field has value "false" AND "Outstanding_Amount_FC__c" field has value greater than 0.

Could you please help me on how we can add filter to handle this situation.

May be somethins i need to change on this line "  <apex:repeat var="cx" value="{!relatedTo.Invoices__r}" >" of below code , but not sure wha exactly need to change.


My Visualforce working code is - 

<messaging:emailTemplate subject="First payment reminder" recipientType="Contact" relatedToType="Account">

<!-- <messaging:plainTextEmailBody >
Congratulations!
This is your new Visualforce Email Template.
</messaging:plainTextEmailBody> -->

<messaging:htmlEmailBody >
    <STYLE type="text/css">
        TH {font-size: 11px; font-face: arial;background: #CCCCCC; border-width: 1;  text-align: center }
        TD  {font-size: 11px; font-face: verdana }
        TABLE {border: solid #CCCCCC; border-width: 1}
        TR {border: solid #CCCCCC; border-width: 1}
     </STYLE>
     <font face="arial" size="2">

<font size="2" face="Lucida Sans Unicode" > Dear  {!relatedTo.Name}, </font><br/>
<br/>

<font size="2" face="Lucida Sans Unicode" >Our financial records show that -- subscription for the total amount {!relatedTo.CurrencyIsoCode}&nbsp;{!relatedTo.Total_Outstanding_Amount__c} </font><br/>
<br/>


 
<br/>
        <table border="0" > 
            <tr>
                <th align="right"><font size="2" face="Lucida Sans Unicode" >Invoice Number   ;</font><br/></th>
                <th align="right"><font size="2" face="Lucida Sans Unicode" >Payment Due Date   ;</font><br/></th>
                <th align="right"><font size="2" face="Lucida Sans Unicode" >Amount Due   ;</font><br/></th>
                <th align="right"><font size="2" face="Lucida Sans Unicode" >Currency   ;</font><br/></th>
                
            </tr>
            
            <apex:repeat var="cx" value="{!relatedTo.Invoices__r}" >

               <tr>
                        <td align="right"><font size="2" face="Lucida Sans Unicode" >{!cx.Invoice_Number__c}&nbsp;</font></td>
                        
                        <td align="right"><font size="2" face="Lucida Sans Unicode" >
                            <apex:outputText value="{0,date,dd'/'MMM'/'yyyy}">
                                <apex:param value="{!cx.Transaction_Due_Date_del__c}" /> 
                            </apex:outputText>&nbsp;</font>
                        </td>


                        <td align="right"><font size="2" face="Lucida Sans Unicode">&nbsp;
                            <apex:outputText style="float:right" value="{0, number, ###,##0.00}">
                                <apex:param value="{!cx.Outstanding_Amount_FC__c}"/>
                            </apex:outputText>&nbsp;</font>
                        </td>
                        
                        <td align="right"><font size="2" face="Lucida Sans Unicode" >{!cx.Currency__c}&nbsp;</font></td>
                                                                        
               </tr>
                                   
            </apex:repeat>
        </table>  
     </font>
                    
<br/>

<font size="2" face="Lucida Sans Unicode" >Our bank details:</font><br/>
<font size="2" face="Lucida Sans Unicode" >Payment reference: {!relatedTo.Exact_Online_Account_ID__c} </font><br/>
<font size="2" face="Lucida Sans Unicode" >Please do not hesitate to contact us with questions. Thank you in advance for your cooperation. </font><br/>

<br/>
<br/>
<br/>  
                
<font size="2" face="Lucida Sans Unicode" >Best regards,</font><br/>
<font size="2" face="Lucida Sans Unicode" >Collection department</font><br/>
<font size="2" face="Lucida Sans Unicode" >BV Amsterdam, the Netherlands</font><br/>
                
</messaging:htmlEmailBody>
</messaging:emailTemplate>
Hello,

I need to send visualforce email address to the Address mentioned on Account's custom field "Billing_E_Mail__c"
Could you please suggest what changes are required in below code ?

My Visualforce working code is - 

<messaging:emailTemplate subject="First payment reminder" recipientType="Contact" relatedToType="Account">

<!-- <messaging:plainTextEmailBody >
Congratulations!
This is your new Visualforce Email Template.
</messaging:plainTextEmailBody> -->

<messaging:htmlEmailBody >
    <STYLE type="text/css">
        TH {font-size: 11px; font-face: arial;background: #CCCCCC; border-width: 1;  text-align: center }
        TD  {font-size: 11px; font-face: verdana }
        TABLE {border: solid #CCCCCC; border-width: 1}
        TR {border: solid #CCCCCC; border-width: 1}
     </STYLE>
     <font face="arial" size="2">

<font size="2" face="Lucida Sans Unicode" > Dear  {!relatedTo.Name}, </font><br/>
<br/>

<font size="2" face="Lucida Sans Unicode" >Our financial records show that -- subscription for the total amount {!relatedTo.CurrencyIsoCode}&nbsp;{!relatedTo.Total_Outstanding_Amount__c} </font><br/>
<br/>


 
<br/>
        <table border="0" > 
            <tr>
                <th align="right"><font size="2" face="Lucida Sans Unicode" >Invoice Number   ;</font><br/></th>
                <th align="right"><font size="2" face="Lucida Sans Unicode" >Payment Due Date   ;</font><br/></th>
                <th align="right"><font size="2" face="Lucida Sans Unicode" >Amount Due   ;</font><br/></th>
                <th align="right"><font size="2" face="Lucida Sans Unicode" >Currency   ;</font><br/></th>
                
            </tr>
            
            <apex:repeat var="cx" value="{!relatedTo.Invoices__r}" >

               <tr>
                        <td align="right"><font size="2" face="Lucida Sans Unicode" >{!cx.Invoice_Number__c}&nbsp;</font></td>
                        
                        <td align="right"><font size="2" face="Lucida Sans Unicode" >
                            <apex:outputText value="{0,date,dd'/'MMM'/'yyyy}">
                                <apex:param value="{!cx.Transaction_Due_Date_del__c}" /> 
                            </apex:outputText>&nbsp;</font>
                        </td>


                        <td align="right"><font size="2" face="Lucida Sans Unicode">&nbsp;
                            <apex:outputText style="float:right" value="{0, number, ###,##0.00}">
                                <apex:param value="{!cx.Outstanding_Amount_FC__c}"/>
                            </apex:outputText>&nbsp;</font>
                        </td>
                        
                        <td align="right"><font size="2" face="Lucida Sans Unicode" >{!cx.Currency__c}&nbsp;</font></td>
                                                                        
               </tr>
                                   
            </apex:repeat>
        </table>  
     </font>
                    
<br/>

<font size="2" face="Lucida Sans Unicode" >Our bank details:</font><br/>
<font size="2" face="Lucida Sans Unicode" >Payment reference: {!relatedTo.Exact_Online_Account_ID__c} </font><br/>
<font size="2" face="Lucida Sans Unicode" >Please do not hesitate to contact us with questions. Thank you in advance for your cooperation. </font><br/>

<br/>
<br/>
<br/>  
                
<font size="2" face="Lucida Sans Unicode" >Best regards,</font><br/>
<font size="2" face="Lucida Sans Unicode" >Collection department</font><br/>
<font size="2" face="Lucida Sans Unicode" >BV Amsterdam, the Netherlands</font><br/>
                
</messaging:htmlEmailBody>
</messaging:emailTemplate>
Hi all,I am trying to create VF email template. I have account object and inside account I have custom object "Invoices", I need help how we can get "Invoices” object fields into template.

My sample code is –
Messaging:emailTemplate subject="Dunning Reminder" recipientType="Contact" relatedToType="Invoice__c">
<!-- <messaging:plainTextEmailBody >
Congratulations!
This is your new Visualforce Email Template.
</messaging:plainTextEmailBody> -->
 
<messaging:htmlEmailBody >
<b> Dear  {!relatedTo.Name} </b><br/>
Our financial records show that we have not yet received funds for your Virtuagym subscription for the total amount of currency_and_total_amount. <br/>
        <table>
            <tr>
                <th>Invoice Number</th>
            </tr>
           
            <apex:repeat var="cx" value="{!relatedTo.Account_invoice__r}" >
               <tr>
                        <td>{!cx.Invoice_Number__c}</td>
               </tr>
                                   
            </apex:repeat>
        </table>                        
 
I am also getting error – “Error: Invalid field Invoice_Number__r for SObject Account”
Additional Info :-
- Invoice__c : Is API name of my Custom Object Invoices
- Account_invoice__c - Child Relationship Name of Invoices with Accounts