Project

sespool

0.0
Repository is archived
No commit activity in last 3 years
No release in over 3 years
Bounce parser for Amazon SES SNS notifications
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies

Development

~> 1.3
>= 0
>= 0
 Project Readme

Sespool Build Status

Bounce parser for Amazon SES SNS notifications. Currently only supports JSON.

Usage

>> bounce = Sespool::Bounce.new("raw sns json request body")
>> bounce.type
=> 'Transient'
>> bounce.bounced_recipients.first.email_address
=> 'foo@example.com'
>> bounce.mail.message_id
=> '123-456-789'

Example Integration

In a Rails app, you might want to setup your SES SNS bounces be be handled by something like the following:

class SnsController < ApplicationController

  def bounce_notification
    # parse the SNS bounce JSON
    bounce = Sespool::Bounce.new(request.raw_post)

    # do something with it, probably persist it
    EmailBounce.create_from_sns_message(bounce)

    render nothing: true, status: 204
  end

end