add tag
5 years ago Anonymous 1399

I have this python code block set for an app that displays email on the FE from json.

So if the there are multiple attachments from the same FROM email, how do i get them together? Currently, only the last attachment in a mail with multiple attachments is entered into the json response.

Top Answer
5 years ago Jack Douglas

Rather than overwriting user_content['ATTACH'] you could append to a sub-list. So instead of:

use something like:

5 years
Jack Douglas replying to Pax — Tuesday, 7th Jul 2020 09:21

Thanks, that’s quite the gotcha!

4 hours
Pax — Tuesday, 7th Jul 2020 05:05

@Jack, re: your answer, {} is a dictionary. You must have meant to use [] or set() in user_content['ATTACH'] = {}

Enter question or answer id or url (and optionally further answer ids/urls from the same question) from

Separate each id/url with a space. No need to list your own answers; they will be imported automatically.