Module: Spree::AdminUserMethods::DeviseNotifications

Defined in:
app/models/concerns/spree/admin_user_methods.rb

Overview

Routes Devise's auth notifications through Spree's own mailer so admin password reset and account confirmation emails carry the store design and locale instead of Devise's built-in templates. Other notification kinds (e.g. unlock instructions) fall through to Devise.

Instance Method Summary collapse

Instance Method Details

#send_devise_notification(notification, *args) ⇒ Object



111
112
113
114
115
116
117
118
119
120
121
122
123
# File 'app/models/concerns/spree/admin_user_methods.rb', line 111

def send_devise_notification(notification, *args)
  token = args.first
  store = Spree::Current.store || Spree::Store.default

  case notification
  when :reset_password_instructions
    Spree::AdminUserMailer.password_reset_email(self, token, store).deliver_later
  when :confirmation_instructions
    Spree::AdminUserMailer.confirmation_email(self, token, store).deliver_later
  else
    super
  end
end