+ Start a Discussion
Support 3743Support 3743 

Inserting query in a Visualforce email template

I want to display all the account-related partners in a Visualforce email template:

relatedToType="Account"
<apex:repeat var="op" value=?>
...
I want value to be a list of all the partners related to the current account. I tried inserting a query: value="{!SELECT Name FROM Account WHERE Id IN (SELECT AccountToId FROM Partner WHERE AccountFromId = relatedTo.Id)}"

The code fails. Can someone help me with this?