У меня есть идея: ПОЛУЧИТЬ zip-файл из s3, прочитать его и передать в API boto3 send_raw_email().
Код: Выделить всё
zip_response = s3_client.get_object(
Bucket='bucket name',
Key='access_key.zip'
)
zip_streambody = zip_response['Body'].read()
#adding the attachment for send_raw_email() operation
'Define attachment and encode using mime app'
att = MIMEApplication(open(ATTACHMENT, 'rb').read())
'header to tell email client to treat it as attachment and give it a name'
att.add_header(
'Content-Disposition',
'attachment',
filename=os.path.basename(ATTACHMENT)
)
Любая помощь приветствуется.
Подробнее здесь: https://stackoverflow.com/questions/564 ... attachment