I tried to use an tag in a visualforce email template and got the following:
Error:
<messaging:emailTemplate>
cannot contain
<apex:dynamicComponent>
Is there any way to get around this or is dynamic visualforce impossible in email templates?
My use case is supporting multiple languages in one email template and allowing the users to modify the text of the email without having to modify the email template.
The users would have a separate object with a long text area where they would enter the text of the email (using visualforce merge fields) as well as translations of that text and then the email template would just have references to that object and would pick the correct translation based on the language of the email recipient. Basically custom labels on steroids.
Best Answer
I'm guessing that it's not possible, though I'd confirm that you're using the latest API version to be sure. But VF email templates have always been a subset of Visualforce, with various limitations. From pg 184 of the Summer '12 Visualforce manual: