You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a documentation error: common_headers is not an iterable, so the list() call fails. I'll submit a PR to fix this, but in the mean time this is the corrected example:
from aws_lambda_powertools.utilities.data_classes import SESEvent
def lambda_handler(event, context):
event: SESEvent = SESEvent(event)
# Multiple records can be delivered in a single event
for record in event.records:
mail = record.ses.mail
common_headers = mail.common_headers
do_something_with(common_headers.to, common_headers.subject)
What were you trying to accomplish?
Expected Behavior
I am trying to process an SES event using Lambda powertools for python.
Current Behavior
Error using this snippet:
Possible Solution
Steps to Reproduce (for bugs)
Environment
The text was updated successfully, but these errors were encountered: