function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Bhaskar525Bhaskar525 

Visual force Email template problem when workflow trigger

Hi friends,

 

         I designed one VF email template and tested that it's working great when i tested. after then i created email alert workflow when workflow trigger the menctioned merged fields are not showing the information. Please help me how i get the information when workflow trigger.

 

The code as shown below.

 

<messaging:emailTemplate subject="Bureau veritas" recipientType="lead" relatedToType="lead" >
<messaging:htmlEmailBody >

Hello:{!relatedto.Name}

Thank you for downloading our white paper <span id="whitepaperTitle">{!relatedto.Download_White_paper_Name__c}</span>.

</messaging:htmlEmailBody>
</messaging:emailTemplate>

 

i tried both recipient and relatedto type to refere field when i used relatedto it shows the name of the lead but not other field information. please help me to comeout from this .

matermortsmatermorts

I copied your template into my dev org, exactly as you have it there, and it works fine for me (I had to create a field for Download_White_paper_name__c).

 

You said the recipient name is populating, but not the other field. Are you sure the "white paper name" custom field is populated on the lead record when the workflow rule fires? (I know, sorry, stupid question)

 

Also, why do you need to use visualforce for this? Seems like a regular text template would do the same thing, only much simpler.

Bhaskar525Bhaskar525

Dear Matermorts,

 

            

Our company provides some services for product testing. We placed those documents in one application. When user wants to see the service document (placed in Whitepaper object) he need to fill the lead form (web-lead designed visual force) when he submit the  lead details are insert into SFDC at that time I capture the Lead download service document name and placed into Lead object (Download_White_paper_name__c) (the application placed in website using sites concept). For lead auto Email  (email template designed using Visualforce it contains our logo and Customer service team information and our company service hyperlink) response I create on workflow, when record created from that site it triggers. When I test the email preview it works great, but when workflow trigger it not capturing the merged field’s info except the Lead name. I didn’t understand why it’s not working. i posted sample code i used in visualforce page.

 

Thanks,

Bhaskar.

matermortsmatermorts
Okay, I guess that explains why you're using visualforce instead of a text template. What type of field is download_white_paper_name__c and is it located on your lead object or is it on a related object?
Bhaskar525Bhaskar525

Dear Matermorts,

 

        The field type is Text and it's located in Lead Object.

 

Thanks,

Bhaskar.

srmthssrmths

Hi ,

 

I think,Visualforce Email Template cannot be used for Email Alert.

Bhaskar525Bhaskar525

Dear Srmths,

                Is there any way to design custom template (I need to insert logo and supporting logo info and hyperlinks of services) other than visualforce template. Or is there any way to send email alert auto response using visualforce template.