I need to populate the merge field for the related accounts creator/owner.

I have these details:-

  <messaging:emailTemplate subject="Employers initiating Enrollment for Employees" recipientType="Contact" relatedToType="Contact">

       <p style="font-size: 12px; line-height: 14px; color: #555555; ont-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; margin: 0;">
              Questions? <br/>
              Contact: {!RelatedTo.Account.CreatedBy.Name} ;<br/>
              Email: {!RelatedTo.Account.CreatedBy.Email} &nbsp;<br/>
              <apex:outputLabel value="Phone: "  
                      rendered="{!RelatedTo.Account.CreatedBy.Phone != null}"/> 
              <apex:outputLabel value="{!RelatedTo.Account.CreatedBy.Phone}" rendered="{!RelatedTo.Account.CreatedBy.Phone != null}" />&nbsp;<br/>
              <apex:outputLabel value="Mobile: "  rendered="{!RelatedTo.Account.CreatedBy.MobilePhone != null}"/>

              {!RelatedTo.Account.CreatedBy.MobilePhone} &nbsp;<br/>


Name is populating, Email, Phone and MobilePhone are not. Send test and anonymous working fine.

  • when is being sent this email? Basic checks: visibility, permissions, ... Sep 23, 2019 at 13:24
  • Contact/Lead/user can not be used for relatedTo; use recipient.Account.CreatedBy.Name
    – cropredy
    Sep 23, 2019 at 19:20
  • I solved by creating Visualforce component and adding without sharing controller to it.
    – mvk1991
    Sep 24, 2019 at 8:35


You must log in to answer this question.

Browse other questions tagged .