I am creating a visualforce email template on a custom object. I want to add the Name,Email, and Phone of the User (object) who is sending the email. I have tried both {!relatedTo.User.Name} and {!relatedTo.CreatedById.Name} but none of them works. I get the error 'Error: Unknown property 'String.Name' when I try to save the template.

  • did you try {!$User.Name} ? ; relatedTo references the custom object, not the running user
    – cropredy
    Commented Nov 19, 2020 at 0:21

1 Answer 1


it should be {!relatedTo.CreatedBy.Name}

Please go thru trailhead or Salesforce Documentation to know how to use dot notation.

You must log in to answer this question.

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