How do I send images with my emails?

Attaching images

The "email" action supports attaching anything that you can express using JSON. (The rest of this article will assume you're familiar with this action.)

If you happen to have your base64-encoded image data on hand, you can attach it with a line like this:

"attachments": {
  "image.jpg": {
    "base64": {{ image_jpg_base64 | json }}
  }
}

Embedding images

You may add image tags in your emails, but please note that Mechanic does not support embedding attached images.

Instead, upload your image to Shopify (learn how), and use the URL provided by Shopify to add your image using HTML:

{% capture email_body %}
  <p>Welcome!</p>
  <img src="https://cdn.shopify.com/s/files/1/0000/0000/0000/files/welcome_email.jpg">
{% endcapture %}
"body": {{ email_body | unindent | json }}
Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.