Base Image URL

Define a base URL that will be prepended to all image sources in your email. It applies to both inline and background images.

Useful if you already host your images somewhere like a CDN, so you don't have to write the full URL every time when developing.

Make it globally available by setting it in your environment config:

// config.js
module.exports = {
  baseImageURL: '',
  // ...

Override it for a single template, through Front Matter:

baseImageURL: ''

{% block template %}
  <!-- ... -->
{% endblock %}

Trailing slash

Mind the trailing slash on your URL: this influences how you reference images.

<!-- If baseImageURL has no trailing slash -->
<img src="/folder/product-1.png">

<!-- If baseImageURL contains trailing slash -->
<img src="folder/product-1.png">


Disable baseImageURL by setting its value to an empty string or a falsy value.

Here's an example of how you can do that with Front Matter:

baseImageURL: ''


baseImageURL: false