+ Start a Discussion
Guru Vemuru 1Guru Vemuru 1 

Problem in feching data from User in Visual Force Email template?

Hi all,
 I am creating Visualforce  email template to add Signature, whenever user send mail other people.
1.In that template i have to fetch uer data like NAME, DIVISION...   .
2.So I created fields in User object and trying to fetch data from user object.
3.when Use send test and verify merge fields showing data,But when we send mail from contact it is fetch data from user .
4. And logo also not displaying.

Here is my code:

<messaging:emailTemplate subject="Regarding Student" recipientType="Lead" relatedToType="user">
<messaging:plainTextEmailBody >

{!RelatedTo.FirstName} {!RelatedTo.LastName}
Division  {!RelatedTo.Division__c}
Segment   {!RelatedTo.Segment__c}
Rechnungsanschrift/Billing address {!RelatedTo.Billing_Address__c}
Mobile            {!RelatedTo.MobilePhone}
Email             {!RelatedTo.Email}  
Visit us @        {!RelatedTo.URL__c}


<img src="https://testguru--test1--c.cs50.visual.force.com/resource/1509087818000/Contitechtest"
    width="200" height="200"/>



Segment   IT
Rechnungsanschrift/Billing address Jeevan Bhema Nagar
Mobile            (
Email             vguru.com 
Visit us @        www. guru.com


<img height="200" src="https://testguru--test1--c.cs50.visual.force.com/resource/1509087818000/Contitechtest" width="200" />
Balayesu ChilakalapudiBalayesu Chilakalapudi
Query User's data in devconsole to check whether it exists or not like this
SELECT FirstName,LastName,Division__c,Segment__c,Billing_Address__c,MobilePhone,Email,URL__c FROM User WHERE Id='give user Id here'
Copy the image link and paste in browser's new tab and check whether it is loading or not. I guess the image link must be like
Guru Vemuru 1Guru Vemuru 1
Thank you Chilakalapudi,

In developer console I am able fetch data.
User-added image