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
AlgypugAlgypug 

Procedure to change Subject field in visualforce email template

 

I currently have a Visualforce email template for sending details relating to a particular account with a custom button.
In the standard email templates, it is possible to include fields in the subject line of the email.  
This allows you to write, for example, New Account: [ACCOUNT NAME] in the subject line of the email.
However, I am not able to find this functionality in the Visualforce email template.
I am sure this must be possible - please help!!!  I am sure this must be extremely simple, but I am not able to find it..
Navatar_DbSupNavatar_DbSup

Hi,

In the Visualforce email template, you can write {!account.name} in the subject line of the email.

 

Follow the below link as reference:

 

http://www.salesforce.com/us/developer/docs/pages/Content/pages_compref_messaging_emailTemplate.htm

 

Did this answer your question? If not, let me know what didn't work, or if so, please mark it solved. 

kcnmaheshkcnmahesh

Sorry Navatar...

 

Still am not getting account name in subject .

I tried with your approach but i didt get subject as account name.

 

My code

 

<messaging:emailTemplate subject="Credit Exposure - {!relatedto.name}" recipientType="Contact" relatedToType="Account">
<messaging:htmlEmailBody >
<c:CreditDataComponent ></c:CreditDataComponent>
</messaging:htmlEmailBody>
</messaging:emailTemplate>

 

 

Also i tried

 

<messaging:emailTemplate subject="Credit Exposure - {!reciepient.account.name}" recipientType="Contact" relatedToType="Account">
<messaging:htmlEmailBody >
<c:CreditDataComponent ></c:CreditDataComponent>
</messaging:htmlEmailBody>
</messaging:emailTemplate>