Skip to content

Instantly share code, notes, and snippets.

@temochka
Created April 22, 2014 15:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save temochka/11183300 to your computer and use it in GitHub Desktop.
Save temochka/11183300 to your computer and use it in GitHub Desktop.
require 'postmark'
client = Postmark::ApiClient.new('API_TOKEN')
puts client.bounces.
first(10).
map { |b| b.values_at(:email, :name, :inactive) }.
unshift(["Email Address", "Bounce Type", "Is inactive?"]).
map(&:to_csv).
join
# Email Address,Bounce Type,Is inactive?
# monty.boyer@neatorobotics.com,Auto responder,false
# kate.moore@mediahive.com,Soft bounce,false
# kate.moore@mediahive.com,Soft bounce,false
# devin@scitools.com,Soft bounce,false
# billing@cpeople.ru,Unknown,false
# billing@seeladora.com,Unknown,false
# billing@seeladora.com,Unknown,false
# kelly@ck-services.co.uk,Spam notification,false
# mirko@xodusnewmedia.com,Soft bounce,false
# tom.pastorello@mediahive.com,Soft bounce,false
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment