Create Images Inline from HTML mail

 See also Enable Inline Images (Inbound and Outbound)

Scenario

You have HTML email that contains images, you would like this images to be displayed within the Issue Description or Comment, rather than through other mechanisms JEMH supports:

  • adding a summary list at the end of the Description/Comment entry with thumnail links to attached images, and links to files.

Solution Approach

The Simplest way to create inline images is to use JIRA's built in support for Wiki Markup.  This markup support is enabled per-field, and so, can be enabled for Description and Comments.  JEMH will then inject the required markup and references to attached files from the email.  This approach maintains the correct use of file system for Files and database for text and markup, rather than storing encoded image fields in the database.



JIRA Configuration

In order to allow inline images, JIRA must be switched to render Descriptions and Comments using the Wiki Style Rendered.



From JIRA administration, click on the Issues tab, edit the Field Configurations, either create one specifically for the project, or update the Default, shown here:

Configure the scheme:

Select Renderers on the comment/Description

Select the WIki Style Renderer.

Once configured you should see the Fields enabled for the Wiki Style Render as follows:



Once JIRA Projects have Wiki Style render selected, wiki markup for images is then available for use, which is how JEMH presents the images:

JEMH Configuration



Content Preference Gotcha alert!

If Descriptions/Comments appear with [image: Inline images 1] type text (or anything similar, as its mail-server vendor specific), as shown below, this indicates your JEMH Content Type preference is not HTML, this will stop inlining:





Incoming email can have text/plain and text/html parts.  For inlining to work JEMH needs to be configured to prefer the text/html in the Profile > Email > Pre-Processing section:

Before

HTML content preferred

Before

HTML content preferred

Configuring Image Appearance Within Issue

To see how images are currently rendered, create a Test Case with an image embedded.  When ran, you will likely get an image in the Issue description using Wiki Markup.

To change how the image is rendered within the Issue Description go to: Profile > Configuration > Email > HTML within this tab, you can switch HTML Image Handling to be different rendering outputs or not to render the image at all.