Sha256: 18a1f2e884a8254156cad4b6b074d0dd2f6698f4419d46ff6796a1166d209ac2

Contents?: true

Size: 439 Bytes

Versions: 8

Compression:

Stored size: 439 Bytes

Contents

# frozen_string_literal: true

module Emailbutler
  module Webhooks
    class Receiver
      def call(mapper:, payload:)
        return unless mapper

        mapper
          .call(payload: payload)
          .each { |event|
            message = Emailbutler.find_message_by(uuid: event.delete(:message_uuid))
            next unless message

            Emailbutler.update_message(message, event)
          }
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
emailbutler-0.8.8 lib/emailbutler/webhooks/receiver.rb
emailbutler-0.8.7 lib/emailbutler/webhooks/receiver.rb
emailbutler-0.8.6 lib/emailbutler/webhooks/receiver.rb
emailbutler-0.8.5 lib/emailbutler/webhooks/receiver.rb
emailbutler-0.8.4 lib/emailbutler/webhooks/receiver.rb
emailbutler-0.8.3 lib/emailbutler/webhooks/receiver.rb
emailbutler-0.8.2 lib/emailbutler/webhooks/receiver.rb
emailbutler-0.8.1 lib/emailbutler/webhooks/receiver.rb