it’s my first post here and first steps with n8n, please be patient
What I’m trying to do:
Receiving an email with one or more attachments. I want to send an email with all attachments that are a pdf to another address. So I added a filter, but I don’t know how the filter should be configured correctly.
@Eulallia , the filter could be something like this
Note the expression used is {{ $binary.attachment_0.fileExtension }} ($binary, not $json). Check out Data structure as a reference to the topic of the data structure in n8n.
that works thank you! If there are more than one PDF in the email, how can I split the PDF so that the filter is on each PDF and after that for each PDF an extra email send?
I tried loop over items but somehow it seems that multiple PDF coing from IMAP are handled as 1 item?
@Eulallia , I haven’t seen how the data looks like when there is more than one attachments. However, as per document on data structure I would expect to see something like
Therefore, you can discover the number of attachments and their names by checking the keys. Something like this, Object.keys($binary). The outcome would be an array of this kind, ["attachment_0", "attachment_1", . . .].
Hopefully you can handle it from here (assuming my understanding of attachments is correct ).