#536 Adding images to the Email Template

Posted in ‘Technical Support / Bugs’
This is a public ticket

Everybody will be able to see its contents. Do not include usernames, passwords or any other sensitive information.

Latest post by Chris Elliott on Friday, 31 October 2025 17:13 UTC

Chris Elliott

I ma creating a new Email Template Design for sales using the standard  J2Commerce: Add / Edit email template route.

All is fine apart from where I want to use an image as a background to the cell in the first row of the output table - here's part of my code - the orange line is relevant.

<table style="width: 600px; border-collapse: collapse; height: 691.844px;" border="0" width="600" cellspacing="0" cellpadding="0" align="center">
<tbody>
<tr style="height: 200px;" valign="top">
<td style="padding: 0px; height: 200px; width: 601.5px;" colspan="2" align="center" bgcolor="transparent" width="600" height="200">
<div style="height: 200px; width: 600px; background-image: url('/images/cellbackground.jpg'); background-repeat: no-repeat; background-size: 600px 200px; background-color: #ffffff;">

...
...
...

In preview mode (in the Editor) all is well and I can see my artwork image, but in the received email the image is not displayed.

I edited as follows (to nail in the full path):

<div style="height: 200px; width: 600px; background-image: url('https://mywebsite.com/images/cellbackground.jpg'); background-repeat: no-repeat; background-size: 600px 200px; background-color: #ffffff;">

However, when I save this comma the URL is stripped back to what it was originally, i.e.

https://mywebsite.com/images/cellbackground.jpg'

reverts to

url('images/cellbackground.jpg')

What am I doing wrong?

Olivier

Hello Chris,

this an editor issue. I had it on my own sites before.

The editor you are using uses relative paths. Therefore, when saving, all internal paths are stripped of the https://mywebsite.com part.

This is something you can probably change in the editor plugin you are using. For instance, in TinyMCE, look for the 'URLs' parameter and set it to 'Absolute'.

Olivier.

Growing Together

Help us get back to #1 in the Joomla Extension Directory by leaving us a 5-Star review here.

Chris Elliott

Excellent response Olivier!

I use JCE Editor and as suggested it was related to the URL Conversion option.

For reference, in JCE Editor, the default value is "Relative".

To change this, go to Components > JCE Editor > Profiles > [Default Profile] > Editor Parameters (tab) > URL Conversion.

Select the method used to convert site specific URLs in content.

  • Relative - The site's protocol and domain are removed from the URL
  • Absolute: The site's protocol and domain are added to the URL
  • None: The URL is left as it is

Maybe use this as an FAQ? Lol!

Chris

Stay Updated

Subscribe for free and be the first to know about the latest features, updates, and new additions.