3

I want to create an email from a template and insert the contents of an rtf field from a record into the email. To this end, I created a visualforce email template (see attached code) enter image description hereMy problem is that when the rtf contents of the field are inserted into the body of the email the formatting is lost (see here) enter image description hereand it is converted back into text. rather than minting the formatting (see here)enter image description here How can I create an email template that will take the contents of an rtf field from a record and insert it into the bey of the email and maintain its formatting? Once I am able to display the formatting correctly (by using the apex code solution below) I still cannot display the image within the RTF field. enter image description here

2

Try doing this:

<apex:outputtext value="{!thefield}" escape="false" />

This should display the HTML correctly.

2
  • Brilliant, that enables me to get the formatting, BUT it does not show the image embedded, I have updated the question to include the screenshot. Any ideas how I get around that issue of not being able to display the image inline? – Bart Oct 7 '14 at 21:45
  • @Bartley: Try using Apex:outputField instead. – PepeFloyd Oct 8 '14 at 8:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.