From a58253a6a1e6bdfa82db91af65a4c81276bfc71c Mon Sep 17 00:00:00 2001 From: Pete Matsyburka Date: Wed, 5 Jun 2024 09:27:18 +0300 Subject: [PATCH] add devise emails events --- config/initializers/devise.rb | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/config/initializers/devise.rb b/config/initializers/devise.rb index db2982c9..147e5113 100644 --- a/config/initializers/devise.rb +++ b/config/initializers/devise.rb @@ -10,6 +10,19 @@ class FailureApp < Devise::FailureApp end end +module Devise + module Mailers + module Helpers + def devise_mail(record, action, opts = {}, &) + assign_message_metadata(action, record) + + initialize_from_record(record) + mail(headers_for(action, opts), &) + end + end + end +end + # Assuming you have not yet modified this file, each configuration option below # is set to its default value. Note that some are commented out while others # are not: uncommented lines are intended to protect your configuration from