Class: Recoil::Message::Notification

Inherits:
Abstract
  • Object
show all
Defined in:
lib/recoil/message/notification.rb

Instance Attribute Summary

Attributes inherited from Abstract

#message

Instance Method Summary collapse

Methods inherited from Abstract

#initialize

Constructor Details

This class inherits a constructor from Recoil::Message::Abstract

Instance Method Details

#process!Object



7
8
9
10
11
12
13
14
15
# File 'lib/recoil/message/notification.rb', line 7

def process!
  body = JSON.parse(message['Message'])
  body['bounce']['bouncedRecipients'].each do |bounce|
    Bounce.create!(
      email: bounce['emailAddress'],
      bounce_type: body['bounce']['bounceType']
    )
  end
end