From d2987da70a208fe9052d837c6e82613272934300 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A2u=20Cao?= Date: Tue, 28 Mar 2023 12:22:17 +0200 Subject: [PATCH] Send Devise emails via Sidekiq --- app/models/user.rb | 4 ++++ config/sidekiq.yml | 1 + 2 files changed, 5 insertions(+) diff --git a/app/models/user.rb b/app/models/user.rb index ebe76cb..0fb5f82 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -63,6 +63,10 @@ class User < ApplicationRecord end end + def send_devise_notification(notification, *args) + devise_mailer.send(notification, self, *args).deliver_later + end + def reset_password(new_password, new_password_confirmation) self.password = new_password self.password_confirmation = new_password_confirmation diff --git a/config/sidekiq.yml b/config/sidekiq.yml index 615bb16..adc65b2 100644 --- a/config/sidekiq.yml +++ b/config/sidekiq.yml @@ -1,3 +1,4 @@ :concurrency: 2 :queues: - default + - mailers