I have rich text area field with an image but when I am trying to include the field using the merge field in the html email template ...image is not displaying in email.Any ways to display image from richtext area field.
2 Answers
Images in Rich Text Fields still require authentication to see them. However, unlike the recent thread regarding attached images, you might be able to work around this, though it's not button-click easy. But a Visualforce page with the rich text field on a public Site should make the image viewable. My only hesitation is whether or not the image URL would be the same in the VF page and the merged rich text field.
-
Visualforce is available for email templates as well, so the Site page would not be necessary in this case, I think. Commented Dec 16, 2013 at 17:28
-
Unless the VF template sends the image with the email, rather than as an href to salesforce.com, I think the result will be the same - it's permissions to the image, not whether or not it's included in the email. Commented Dec 16, 2013 at 17:37
-
I see, so the Site guest user will need the appropriate field and object access permissions. Commented Dec 16, 2013 at 17:42
-
You might want to try using a VisualForce email template with the tag:
<apex:outputField value="{!objectname.RTFname__c}"/>
Note that the field, like all data in your email template has to be accessible to the recipient. You might try using a public VF page (described in comments above), but another approach might be building logic into a custom component and style sheet to access an image from static resource (which you can update with the Metadata API): https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_email_templates_stylesheets.htm
-
I tried that and it doesn't work for embedded (=> directly pasted) images into a Rich Text Field. This answers more in detail why: trailblazers.salesforce.com/answers?id=9063A0000019acIQAQ– jjblancoCommented Jul 13, 2020 at 21:24