Email: iterating trough cid's and replace with base64 image

Hi all,

I am trying to process an email with inline images and send it to other mails, PDF, … The images are inline, so an image tag with a cid

<img src="cid:ii_ma28yrrb0" >

I am iterating through the attachments to replace the cid with the base64 image:

<img src="data:image/png;base64 ( ...long text here...) >

This will result in an email I can process further without relying on the attachment. This all works fine.. almost :slight_smile:. The text parser after the array iterator replaces the cid by the base64 image, the problem is: it is using the same source on every iteration. I tried to solve this using a variabele in stead of the html source, with no luck so far.

So my question is: if I have two images in my mail, how do I tell the Text parser to use the html as source in the first iteration and in the second iteration the result from the first (and so on…).


blueprint-iterator.json (14.4 KB)

Thanks in advance, have a good day!

Marcel

To explain this a bit more:

In the first iteration, the Text parser is replacing the first cid with the first base64


:+1:

In the second iteration the Text parser is replacing the second cid with the second base64, this is great but it’s using the initial html as the source, where it should use the first output bundle as a source.

How do I achieve multiple replacements in the same text?

You need a Get Variable after the Iterator module too, to get the latest version of the variable from the previous Iteration.

1 Like

You are right, this is exactly what I needed. So, with some extra administration, the complete solution to replace inline images (cid) in emails, for example from Gmail, with the attachements:
blueprint-inline-images.json (16.2 KB)

1 Like