Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
luca-vari committed Nov 27, 2024
2 parents ddd65fa + 045c75d commit 5885ade
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions app/emails/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,14 @@ def events_email_view(request):
if event_type == "delivered":
email.state = EmailState.DELIVERED
elif event_type in ["bounce", "dropped", "spamreport"]:
# NOTE: rudimentary handling of duplicate events.
if email.state == EmailState.DELIVERY_FAILURE:
logger.info(
"Skipping duplicate email event %s for email with sendgrid ID %s",
event_type,
sendgrid_id,
)
continue
email.state = EmailState.DELIVERY_FAILURE

email.sendgrid_id = sendgrid_id
Expand Down

0 comments on commit 5885ade

Please sign in to comment.