0

I need to add some reciepeients in the "Additional To:" field of my email template. How do I do it for visualforce templates?

<messaging:emailTemplate subject="{!relatedTo.Name} No  Changes" recipientType="User" relatedToType="Opportunity">
<messaging:plainTextEmailBody >
[email protected]; {!relatedTo.Owner.Email}

Hello

Thank you

{!relatedTo.Custom__c}



</messaging:plainTextEmailBody>

<messaging:attachment renderAs="pdf" filename="Checklist" rendered="{!relatedTo.Checklists__c > 0}">


 <html>
        <head/>
        <body>
<c:TemplateHelper opportunityIDFromEmail="{!relatedTo.id}" />
  </body>
    </html>
</messaging:attachment>


</messaging:emailTemplate>
2
  • Based on your comments on my answer, it appears your question may need correct to avoid confusion. When one hears "the to field", one naturally presumes that you mean the email composition screen.
    – sfdcfox
    Commented Jan 13, 2014 at 19:30
  • I do what it in the "Additional To:" field Commented Jan 13, 2014 at 19:44

2 Answers 2

0

You cannot do this using Visualforce email templates in the standard email alerts system. You will have to use the Messaging functionality to send email messages.

If you look at this question from the Salesforce discussion forums you can find more information about the code required to do this.

0

Email templates do not specify recipients; they only specify the subject, content, and attachments of the email message to send. If you need guaranteed delivery to a certain address, you can look at Compliance BCC Emails.

6
  • You can do it in text emails though. with the top line = {!Opportunity.OwnerEmail}... how come i can't do that in VF? Commented Jan 13, 2014 at 19:19
  • 1
    @nivyaj You use "RelatedTo" instead of the specific object name. Here's the equivalent merge field in a Visualforce template: {!RelatedTo.Owner.Email}.
    – sfdcfox
    Commented Jan 13, 2014 at 19:33
  • i updated the post with code. I see what you're saying, but it isn't working. Commented Jan 13, 2014 at 19:39
  • How are you sending the email, and where from? The salesforce.com email client does not automatically add additional to addresses when using any type of template.
    – sfdcfox
    Commented Jan 13, 2014 at 19:44
  • from the activity history send an email... Commented Jan 13, 2014 at 19:50

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .