Skip to content

Commit

Permalink
print email details for debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
longhotsummer committed Jun 26, 2024
1 parent c0fdcfe commit 98121fb
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions service.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,9 @@ def email_from_s3(event, context):
f.seek(0)
msg = email.message_from_string(f.read().decode('utf-8'))

details = "\n".join([f"{k}: {v}" for k, v in msg.items()])
print(f"Processing message: \n---\n{details}---")

# clean up the message id to use a as a prefix to ensure the pdf names are unique
msg_id = re.sub('[^[email protected]]', '-', msg['message-id'])

Expand Down

0 comments on commit 98121fb

Please sign in to comment.