top of page

Inline Images - Let's Find Them

Writer's picture: Sean FieldingSean Fielding

In a recent post, Is Branding Impacting Your Data Storage? Maybe., we explored how inline images can affect your overall data storage footprint (Yes, this concerns data storage, not file storage).


As mentioned, a typical inline logo image can easily add 100KB to an email template. (A more complex email template with inline signatures, inline foot images, etc., can quickly add much more.) That same image, when used as a referenced document link, only adds 5KB. In just 10,000 email threads, this small change can save your instance 1GB in data storage. 


If you are interested in examining your own instance for inline images, here's some information to help you get started.


Please note. This is not a comprehensive list. You will need to customize your search for inline images based on your unique configuration. However, this will provide you with some ideas and a starting point.


     What are we searching for?   

We are searching for HTML code that leverages the inline image syntax. Specifically, we are searching for the appearance of "data:image/*;base64. For example:


<img border="0" src="data:image/png;base64, iVBORw0KGgoAAAANSUhEUgAAABcAA...


These inline images will be hard to miss. The base64 encoded data will be a lengthy string.


     Search the Brand Template object   

The BrandTemplate object serves as the letterhead for HTML email templates. This is where you will typically find the header and footer images. To find your letterhead, run the following query and manually inspect the Value field.


SELECT Id, Value

FROM BrandTemplate


Note: SOSL is not available for the BrandTemplate object.


     Search the Email Template object

The EmailTemplate object denotes email templates in your instance. To find inline images in email templates, run the following SOSL query.


FIND {image/png;base64} IN ALL FIELDS RETURNING EmailTemplate(Id, HTMLValue)


Note: Ideally, the SOSL above would leverage wildcards. For example, FIND {image/???;base64} would find all inline images regardless of the specific file type. In our experience, SOSL with wildcards does not perform well on the various HTML fields. Therefore, it is advisable you run individual searches for the most popular image types.


FIND {image/png;base64} IN ALL FIELDS RETURNING EmailTemplate(Id, HTMLValue)

FIND {image/jpg;base64} IN ALL FIELDS RETURNING EmailTemplate(Id, HTMLValue)

FIND {image/jpeg;base64} IN ALL FIELDS RETURNING EmailTemplate(Id, HTMLValue)

FIND {image/gif;base64} IN ALL FIELDS RETURNING EmailTemplate(Id, HTMLValue)

FIND {image/tiff;base64} IN ALL FIELDS RETURNING EmailTemplate(Id, HTMLValue)

FIND {image/bmp;base64} IN ALL FIELDS RETURNING EmailTemplate(Id, HTMLValue)

FIND {image/svg;base64} IN ALL FIELDS RETURNING EmailTemplate(Id, HTMLValue)


     Search the Email Message object   

The EmailMessage object contains all your email interactions. Searching the Email Message object may provide a glimpse into other areas to investigate. Take note of the Incoming field. It indicates if the email was received (incoming = true) or sent (incoming = false).


FIND {image/png;base64} IN ALL FIELDS RETURNING EmailMessage(Id, HTMLBody)

FIND {image/jpg;base64} IN ALL FIELDS RETURNING EmailMessage(Id, HTMLBody)

FIND {image/jpeg;base64} IN ALL FIELDS RETURNING EmailMessage(Id, HTMLBody)

FIND {image/gif;base64} IN ALL FIELDS RETURNING EmailMessage(Id, HTMLBody)

FIND {image/tiff;base64} IN ALL FIELDS RETURNING EmailMessage(Id, HTMLBody)

FIND {image/bmp;base64} IN ALL FIELDS RETURNING EmailMessage(Id, HTMLBody)

FIND {image/svg;base64} IN ALL FIELDS RETURNING EmailMessage(Id, HTMLBody)








Recent Posts

See All

Comentarios


bottom of page