You need to sign in to do that
Don't have an account?
Merging custom HTML text with HTML email templates
Hello. We are using a Visualforce page to store HTML in a field called "Email_Text__c" using this:
<apex:inputTextarea value="{!Lead.Email_Text__c}" richText="true" cols="40" rows="8"/>
In my email template I insert this value as follows:
<body><p class="style11">{!Lead.Email_Text__c}</p>
When we send an email and select the template containing this value we see the escaped HTML in the body of the email itself. Can anyone think of ways to address this? It is important that our users be able to leverage the embedded wysiwyg editor on the field itself.
Dear Frank,Hello there. Nice <strong>meeting</strong> you.<br /> <br /> I would like to discuss X, Y and Z. Let's get together <em>soon</em>.<br type="_moz" />
Escaping is an automatic feature designed to prevent cross-scripting issues. But, you can override it by telling Salesforce's technology that you're aware that there might be HTML code. You can do this by using the outputText tag:
<apex:outputText escape="false" value="{!Lead.Email_Text__c}"/>
This informs Visualforce that you'd like to display whatever HTML code might be in your field verbatim without escaping the code (i.e. < becomes < if escape="true", which is the default).All Answers
Escaping is an automatic feature designed to prevent cross-scripting issues. But, you can override it by telling Salesforce's technology that you're aware that there might be HTML code. You can do this by using the outputText tag:
<apex:outputText escape="false" value="{!Lead.Email_Text__c}"/>
This informs Visualforce that you'd like to display whatever HTML code might be in your field verbatim without escaping the code (i.e. < becomes < if escape="true", which is the default).Thanks! I knew about that and forgot, having built an entire site with Sites and storing HTML in custom objects. Thanks for the reminder...
-Jim