demarches-normaliennes/config/initializers/mail_observers.rb

11 lines
397 B
Ruby
Raw Normal View History

# 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