feat: Add support for Instagram delivery reports (#8125)
This commit is contained in:
@@ -7,7 +7,7 @@ class Webhooks::InstagramEventsJob < MutexApplicationJob
|
||||
base_uri 'https://graph.facebook.com/v11.0/me'
|
||||
|
||||
# @return [Array] We will support further events like reaction or seen in future
|
||||
SUPPORTED_EVENTS = [:message].freeze
|
||||
SUPPORTED_EVENTS = [:message, :read].freeze
|
||||
|
||||
def perform(entries)
|
||||
@entries = entries
|
||||
@@ -45,6 +45,10 @@ class Webhooks::InstagramEventsJob < MutexApplicationJob
|
||||
::Instagram::MessageText.new(messaging).perform
|
||||
end
|
||||
|
||||
def read(messaging)
|
||||
::Instagram::ReadStatusService.new(params: messaging).perform
|
||||
end
|
||||
|
||||
def messages(entry)
|
||||
(entry[:messaging].presence || entry[:standby] || [])
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user