[Fix #2068] Use mail templates from application rather than devise

`default template_path:` was the documented way, but wasn’t working
(and there was no hint in the source code of Devise that it could
work)

Therefore, let’s override `template_paths` instead and stop worrying
This commit is contained in:
Frederic Merizen 2018-06-08 19:41:34 +02:00 committed by Mathieu Magnin
parent 41dbd9d599
commit bae7a2dd3c

View file

@ -1,6 +1,9 @@
class DeviseUserMailer < Devise::Mailer
helper :application # gives access to all helpers defined within `application_helper`.
include Devise::Controllers::UrlHelpers # Optional. eg. `confirmation_url`
default template_path: 'devise_mailer' # to make sure that your mailer uses the devise views
layout 'mailers/layout'
def template_paths
['devise_mailer']
end
end