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)
Activity
to-mc commentedon Nov 19, 2020
This is a documentation error:
common_headersis not an iterable, so thelist()call fails. I'll submit a PR to fix this, but in the mean time this is the corrected example:heitorlessa commentedon Nov 27, 2020
Now available in the docs - closing it :)