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
    Nov 19 '20 at 0:21

it should be {!relatedTo.CreatedBy.Name}

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.