+ Start a Discussion
Tuur Dutoit 13Tuur Dutoit 13 

Unknown property 'UserStandardController.recipient'

I'm making a Visualforce email template, and I would like to pass the recipient (a User) to a custom component. Basically, I have the following setup (leaving out some unrelevant content).

<messaging:emailTemplate subject="..."
  <messaging:htmlEmailBody >
    <c:Email recipient="{!recipient}">
      <p>Some content...</p>

Custom component:
<apex:component access="global">
  <apex:attribute type="User" name="recipient" description="The user recieving this email" access="global" />
          <c:email_styles />
          <p>Dear {!recipient.Name},</p>
          <apex:componentBody />

I saved the component successfully, but when saving the template, I get the following error: Unknown property 'UserStandardController.recipient'​.

Any ideas what might be causing this?
Best Answer chosen by Tuur Dutoit 13
Tuur Dutoit 13Tuur Dutoit 13
Naming the attribute in the component differently made the error go away:
<attribute name="r" type="User" description="..." />
<c:Email r="{!recipient}">...</c:Email>
Works like a charm! Weird bug, though.