You need to sign in to do that
Don't have an account?
How can I set the ToAddress in a VisualForce email template?
Hello
I created a component/class that returs the email address of the Primary Contact Role for an opportunity.
Now I would like to use this value to prepopulate the "TO" address when I chose to use this template.
Below is the page I have created.
How can use the mail.setToAddresses method?
Thanks
Giorgio
<messaging:emailTemplate subject="Thanks for your business" recipientType="Contact" relatedToType="Opportunity">
<messaging:plainTextEmailBody >
subject="Test Giorgio Contact Roles"
Congratulations!
This is your new Visualforce Email Template.
Thanks for your donation of
mail.setToAddresses(<c:MyEmailComponent componentValue="{!relatedTo.id}" />)
</messaging:plainTextEmailBody>
</messaging:emailTemplate>
Thanks