Use deliver_later in devise

Do not send devise mails directly in the request but through the
delayed jobs.
This commit is contained in:
Henne Vogelsang 2019-01-29 23:20:22 +01:00
parent 0f5181ccf4
commit 334f84179f
2 changed files with 6 additions and 2 deletions

View file

@ -287,4 +287,8 @@ class User < ApplicationRecord
errors.add(:biography, 'is limited to 150 words.') if biography.split.length > 150
end
end
def send_devise_notification(notification, *args)
devise_mailer.send(notification, self, *args).deliver_later
end
end