Embedding images in Email

Hey there! :wave:t2:

I had trouble embedding an image directly into the body of an email using the Email module. Despite reading other posts, I couldn’t find the right solution. The most helpful advice was to download the image (e.g., from Google Drive), use an array aggregator, and map the output like so:

It worked, but the image appeared both inline and as an attachment. I wanted the image only in the email body.

After several tests, I found a solution that work perfectly:


Here are the steps I followed:

  1. Set up a trigger (I used a variable module just for testing).
  2. Download the file from Google Drive.
  3. Use the array aggregator.
  4. Create an email draft set as shown in the first screenshot.
  5. Retrieve the data from the newly created draft.
  6. Send an email with the mapped content only, ensuring the image is in the body, not as an attachment:

    As you can see, I only map the content. This means that I will have the image in the body of the email but NOT as attachment.
  7. Move the draft to the trash to clean up.

Now, this method works well and I hope that it can be helpful for some of you, but I’m curious if there’s a more streamlined way to do this with fewer steps?

Cheers!

1 Like

Hey, sound good. What is your config from the “Get-Emails”-Widget? I have an email webhook as an entry point. I receive an email with two attachments. how can i choose which attachment i want to include in the body?

Best!

Hey,

I simply use the Email ID from the “Create a Draft” module.

To choose the attachment to include, you have to iterate through the attachments and filter the one you need. This means that you can automatically select the target attachment only if you have some standard parameters you can use to filter.