You need to sign in to do that
Don't have an account?

How can we select the email address from Account fields for visualforce email template
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} {!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} </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> </font>
</td>
<td align="right"><font size="2" face="Lucida Sans Unicode">
<apex:outputText style="float:right" value="{0, number, ###,##0.00}">
<apex:param value="{!cx.Outstanding_Amount_FC__c}"/>
</apex:outputText> </font>
</td>
<td align="right"><font size="2" face="Lucida Sans Unicode" >{!cx.Currency__c} </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>
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} {!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} </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> </font>
</td>
<td align="right"><font size="2" face="Lucida Sans Unicode">
<apex:outputText style="float:right" value="{0, number, ###,##0.00}">
<apex:param value="{!cx.Outstanding_Amount_FC__c}"/>
</apex:outputText> </font>
</td>
<td align="right"><font size="2" face="Lucida Sans Unicode" >{!cx.Currency__c} </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>
You have to select the email Address From Visualforce Page ?
Please try Following Process If Yes !!
OR
Regards,
Soundar.
As you mentioned above "You have to select the email Address From Visualforce Page ?"
What is other way to select email address, do you mean in Email Alert ?
1. Select the Email Field On same Object Throught the VF Page !
2. Selct the Email Field from visualforce page by the controller !
I tThink You'r asked 1st step only..
Ask me if you have any other concerns ...
Regards,
Soundar.
Where exactly i have to add below part in my code ? can u pleas ehelp
1<apex:inputfield value="{!relatedTo.EmailField__c}" />
Pease Find The Following Code ...
Thanks !!
Regards,
Soundar.
You Can Mail Me If you have any doubts.
sourajking@gmail.com