demarches-normaliennes/config/initializers/mail_observers.rb

13 lines
428 B
Ruby
Raw Normal View History

# frozen_string_literal: true
# Must be registered *before* loading custom delivery methods
# otherwise the observer won't be invoked.
#
2023-03-06 17:06:10 +01:00
require_relative "../../app/services/email_delivery_observer"
require_relative "../../app/services/email_delivering_interceptor"
2023-03-06 17:06:10 +01:00
ActiveSupport.on_load(:action_mailer) do |mailer|
mailer.register_interceptor EmailDeliveringInterceptor
mailer.register_observer EmailDeliveryObserver
end