Thursday, May 21, 2026

Adding a Static Image as an Encoded Base64 String in Maximo Communication Templates

Adding a static image as an Encoded Base64 String in Maximo Communication Templates.

For static images that don't change frequently and where additional compression is not required, images can be embedded directly into a Maximo Communication Template as a Base64-encoded string, instead of hosting them from a server. 

The HTML <img> tag supports two methods for displaying images:

Using a Hosted image URL

<img src="https://unsplash.com/photos/a-puffin-peeks-out-from-white-flowers-V7KIXbMOuJw" / >
Using an Embedded Base64 Image
<img src="data:image/jpg;base64,iVBORw0KGgoAAAANSUhEUgAAApsAAAC4CAYAAACsNSfVAAAAAXNSR0IAr...." / >
<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAApsAAAC4CAYAAACsNSfVAAAAAXNSR0IAr...." />

By embedding images directly into the communication template, the image becomes self-contained and no longer depends on an external hosting location.

Converting an Image to Base64

An image can be converted into a Base64 string using various free online conversion tools.

  • Download the image from its source URL or local location
  • Upload the downloaded image to a Base64 conversion website
  • Click the Encode button to generate the Base64-encoded string
  • Copy the generated string and use it within the HTML img tag

                  

Adding a Static Image in Maximo Communication Templates

A static image can be added to a Communication Template either through the MAS UI or by updating the database directly. 

Using MAS UI
Open the Communication template and insert an image using the Insert Image Icon. 



Click "View HTML Source" to modify the underlying HTML and add a static image using a Base64-encoded string.

Manually add the img tag with src attribute containing the Base64 string.

Click on "View HTML source" icon again to return to rendered view and preview the static image in the Message section. 

It shows the differentiation between Images loaded from a hosted URL vs Images embedded directly as Base64 String. 


Updating the Database Directly using SQL
Alternatively, the existing hosted image URL in the communication template can be replaced with a Base64-encoded string directly in the database.

update commtemplate
set message = replace (    
message,
'http://hostname/images/logo.jpg', 'data:image/jpg;base64,/9j/4QC8RXhpZgAASUkqAAgAAAAGABIBAwABAAAAAQAAABoBBQABAAAAVgAAABsBBQABAAAAXgAAACgBAwABAAAAAgAAABMCAwABAAAAAQAAAGmHBAABAAAAZgAAAAAAAABgAAAAAQAAAGAiQnm=' ) where status ='ACTIVE';
This approach is useful when updating multiple communication templates or replacing existing hosted images in bulk.

Before using Base64 images in communication templates, consider the following:
  • Base64 images increase the overall HTML message size and performance.
  • This method is best suited for small static images (icons, banners etc.,) which don't change often.
  • If the image changes frequently or is large in size, hosting it externally may be a better option.

No comments:

Post a Comment