From 061e3cd7229af1978dbe9ddcfd80c4867d54271d Mon Sep 17 00:00:00 2001 From: luisramos0 Date: Fri, 5 Jul 2019 22:29:51 +0100 Subject: [PATCH] Add user mailer from spree_auth_devise --- app/mailers/spree/user_mailer.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 app/mailers/spree/user_mailer.rb diff --git a/app/mailers/spree/user_mailer.rb b/app/mailers/spree/user_mailer.rb new file mode 100644 index 0000000000..8d8e95e7aa --- /dev/null +++ b/app/mailers/spree/user_mailer.rb @@ -0,0 +1,12 @@ +module Spree + class UserMailer < BaseMailer + def reset_password_instructions(user) + recipient = user.respond_to?(:id) ? user : Spree.user_class.find(user) + @edit_password_reset_url = spree.edit_spree_user_password_url(:reset_password_token => recipient.reset_password_token) + + mail(:to => recipient.email, :from => from_address, + :subject => Spree::Config[:site_name] + ' ' + + I18n.t(:subject, :scope => [:devise, :mailer, :reset_password_instructions])) + end + end +end