Embedded Images in Rich Text Areas

A rich field type in Salesforce is a field type where users can enter formatted text and add images and links.

Overview

To back up an embedded image, you must have a record with an image embedded in a rich text area field conforming to the following pattern for HTML <img> tag parameters.

Pattern for HTML <img> Tag Parameters

The rich text area field contains the image in the form of an HTML <img> tag containing parameters in a structured format as follows:

<img src="https://yourinstance.salesforce.com/servlet/rtaImage?
        eid=[15-character ID]&amp;
        feoid=00N[12-character field ID]&amp;
        refid=0EM[12-character reference ID]">
        </img>
Warning
Warning The <img> parameters must follow this pattern for the embedded image to back up.

Example of an <img> Tag in a Rich Text Area

The following example shows an <img> tag from a rich text area field:

 <img alt="Sarah Loehr." 
           src="https://MyDomainName.file.force.com/servlet/rtaImage?
           eid=00QRM000003ZfDb&amp;
           feoid=00NRM000001E73j&amp;
           refid=0EMRM00000002Ip">
        </img>

For further information see the Salesforce article, Get an Image from a Rich Text Area Field.

Embedded Images in EmailMessages

Since embedded images are references to an Attachment or ContentVersion object containing the image, when restoring an EmailMessage with an embedded image in its HTMLBody, it can be pointing to an Attachment or ContentVersion that was restored alongside it.

When the Attachment or ContentVersion is restored, it will have a new Id. This means that the reference in the embedded image no longer points to the correct Attachment or ContentVersion, resulting in the image being broken in the restored EmailMessage.