I have a list of error messages:
errors = [
"this is an error",
"this is another error",
]
I am then sending this as an email using Amazon SES:
ses_client.send_email(
Destination={
"ToAddresses": [
"email@email.email",
],
},
Message={
"Subject": {
"Charset": "UTF-8",
"Data": "Processed tracking file",
},
"Body": {
"Text": {
"Charset": "UTF-8",
"Data": f"Finished Processing tracking file\n\n"
f"Sent {NUM_OF_EMAILS} emails"
f"\n".join(ERRORS)
}
},
},
Source="email@email.com",
)
However, this seems to mess up the fString with the first error being the first line of the message, then the Finished Processing tracking file
bit followed by the remaining errors.
Is there a cleaner way to do this?