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
MLamb2005MLamb2005 

HTML in a Visualforce email not rendering proper

I'm having issues with a Visualforce email template that is hooked up to our Ideas tab.  Each time a new idea is submitted this email goes out.  Problem is, if the Idea comments contain any formatting (i.e. bold, bullets, italics, etc), those things are not expressed correctly in the resulting email.  I end up seeing tags (i.e. <strong>) as well as characters not coming across properly (i.e. ‘&#39’ instead of the apostrophe.

 

Does anyone know how I can make the HTML render correctly?  Or, how about just stripping it down to display as regular text in the email?


Thanks!

Best Answer chosen by Admin (Salesforce Developers) 
Edwin VijayEdwin Vijay

Hi,

 

Are you using {!obj.field__c} as such to display the comments?

 

If yes, do add it to an apex:outputfield tag,

 

 

<apex:outputfield value="{!obj.field__c}"/>

 This takes care of the formatting i hope, let me know if it doesnt