Sha256: 20638b276c1e49a84e656683d3711816bb8164561b3d997d7adb8cff3c0d06f9

Contents?: true

Size: 611 Bytes

Versions: 16

Compression:

Stored size: 611 Bytes

Contents

module Marty
  module Notifications
    module CreateDeliveries
      class << self
        def call(notification:)
          configs(notification).map do |config|
            notification.deliveries.create!(
              state: :pending,
              delivery_type: config.delivery_type,
              recipient: config.recipient,
              text: config.text
            )
          end
        end

        def configs(notification)
          Marty::Notifications::Config.where(
            state: :on,
            event_type: notification.event_type
          )
        end
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
marty-14.3.0 app/services/marty/notifications/create_deliveries.rb
marty-14.0.0 app/services/marty/notifications/create_deliveries.rb
marty-13.0.2 app/services/marty/notifications/create_deliveries.rb
marty-11.0.0 app/services/marty/notifications/create_deliveries.rb
marty-10.0.3 app/services/marty/notifications/create_deliveries.rb
marty-10.0.2 app/services/marty/notifications/create_deliveries.rb
marty-10.0.0 app/services/marty/notifications/create_deliveries.rb
marty-9.5.1 app/services/marty/notifications/create_deliveries.rb
marty-9.5.0 app/services/marty/notifications/create_deliveries.rb
marty-9.3.3 app/services/marty/notifications/create_deliveries.rb
marty-9.3.2 app/services/marty/notifications/create_deliveries.rb
marty-9.3.0 app/services/marty/notifications/create_deliveries.rb
marty-8.5.0 app/services/marty/notifications/create_deliveries.rb
marty-8.4.1 app/services/marty/notifications/create_deliveries.rb
marty-8.3.1 app/services/marty/notifications/create_deliveries.rb
marty-8.2.0 app/services/marty/notifications/create_deliveries.rb