active_delivery

Ruby framework for keeping all types of notifications (mailers, push notifications, whatever) in one place

MIT License

Downloads
467.2K
Stars
598
Committers
12

Bot releases are visible (Hide)

active_delivery - 1.2.0 Latest Release

Published by palkan 9 months ago

Features

  • Added Minitest assertions for deliveries:
require "active_delivery/testing/minitest"

class MyDeliveryServiceTest < Minitest::Test
  include ActiveDelivery::TestHelper

  def test_delivers_notification
    assert_delivery_enqueued(Community::EventsDelivery, :modified, with: [event]) do
      some_action
    end
  end

  def test_no_notification_is_delivered
    assert_no_deliveries do
      some_action
    end

    # Alternatively, you can use the positive assertion
    assert_deliveries(0) do
      some_action
    end
  end
end
active_delivery - 1.1.0

Published by palkan 11 months ago

Features

  • Add delayed delivery options support to #deliver_later.

    Now you can specify when to perform the delivery (similar to Action Mailer):

     PostDelivery.with(user:, post:).new_comment(comment).deliver_later(wait_until: 1.hour.from_now)
    
active_delivery - 1.0.0

Published by palkan about 1 year ago

Highlights

  • Abstract Notifier is now a part of Active Delivery.

These gems are used together in ~100% cases, so maintaining them independently doesn't bring any value. Less gems to add to your Gemfile!

  • Notifiers now quack more like mailers from Action Mailer: we added callbacks support, refactored async delivery implementation to build notifications only before the delivery (i.e., in the background job, not at the enqueuing time).

  • More ways to organize files and define delivery to notifier name mappings. See docs.

  • Delivery classes now can explicitly specify which delivery actions are supported (the .delivers API).

See Changelog for the list of all changes.