- Add Minitest assertions (
assert_deliveries
,assert_no_deliveries
,assert_delivery_enqueued
). (@palkan)
- Support delayed delivery options (e.g,
wait_until
). (@palkan)
-
Add
resolver_pattern
option to specify naming pattern for notifiers without using Procs. (@palkan) -
[!IMPORTANT] Notifier's
#notify_later
now do not process the action right away, only enqueue the job. (@palkan).This matches the Action Mailer behaviour. Now, the action is only invoked before the delivery attempt.
-
Add callbacks support to Abstract Notifier (
before_action
,after_deliver
, etc.). (@palkan) -
Merge in abstract_notifier (@palkan)
Abstract Notifier is now a part of Active Delivery.
-
Add ability to specify delivery actions explicitly and disable implicit proxying. (@palkan)
You can disable default Active Delivery behaviour of proxying action methods to underlying lines via the
ActiveDelivery.deliver_actions_required = true
configuration option. Then, in each delivery class, you can specify the available actions via the.delivers
method:class PostMailer < ApplicationMailer def published(post) # ... end def whatever(post) # ... end end ActiveDelivery.deliver_actions_required = true class PostDelivery < ApplicationDelivery delivers :published end PostDelivery.published(post) #=> ok PostDelivery.whatever(post) #=> raises NoMethodError
-
Add
#deliver_via(*lines)
RSpec matcher. (@palkan) -
BREAKING The
#resolve_class
method in Line classes now receive a delivery class instead of a name:# before def resolve_class(name) name.gsub(/Delivery$/, "Channel").safe_constantize end # after def resolve_class(name) name.to_s.gsub(/Delivery$/, "Channel").safe_constantize end
-
Provide ActionMailer-like interface to trigger notifications. (@palkan)
Now you can send notifications as follows:
MyDelivery.with(user:).new_notification(payload).deliver_later # Equals to the old (and still supported) MyDelivery.with(user:).notify(:new_notification, payload)
-
Support passing a string class name as a handler class. (@palkan)
-
Allow disabled handler classes cache and do not cache when Rails cache_classes is false. (@palkan)
-
Add
skip_{before,around,after}_notify
support. (@palkan) -
Rails <6 is no longer supported.
-
Ruby 2.7+ is required.
- Added
ActiveDelivery::Base.unregister_line
(@thornomad)
- Fix parameterized mailers support in Rails >= 5.0, <5.2 (@dmitryzuev)
- Allow resolve mailer class with custom pattern (@brovikov)
- Fixed TestDelivery fiber support. (@pauldub)
-
Add support of :only, :except params for callbacks. (@curpeng)
-
Add negation rspec matcher:
have_not_delivered_to
. (@StanisLove) -
Improve RSpec matcher's failure message. (@iBublik)
- Backport
ActionMailer::Paremeterized
for Rails <5. (@palkan)
Initial version.