demarches-normaliennes/app/mailers/devise_user_mailer.rb

46 lines
1.4 KiB
Ruby
Raw Normal View History

# Preview all emails at http://localhost:3000/rails/mailers/devise_user_mailer
2018-05-14 14:21:03 +02:00
class DeviseUserMailer < Devise::Mailer
helper :application # gives access to all helpers defined within `application_helper`.
helper MailerHelper
2018-05-14 14:21:03 +02:00
include Devise::Controllers::UrlHelpers # Optional. eg. `confirmation_url`
include MailerDefaultsConfigurableConcern
include MailerDolistConcern
include MailerMonitoringConcern
include BalancedDeliveryConcern
include PriorityDeliveryConcern
2018-05-14 14:21:03 +02:00
layout 'mailers/layout'
default from: "#{APPLICATION_NAME} <#{CONTACT_EMAIL}>"
def template_paths
['devise_mailer']
end
# Note: this devise hook (like any callback) is called *after* the action,
# because we use mailers with Mailer.action_name() syntax
# instead of parameterized Mailer.with().action_name.
# So any action using Current must manually call `configure_defaults_for_user`
def initialize_from_record(record)
configure_defaults_for_user(record)
super
end
def confirmation_instructions(record, token, opts = {})
configure_defaults_for_user(record)
opts[:from] = Current.no_reply_email
opts[:reply_to] = Current.no_reply_email
@procedure = opts[:procedure_after_confirmation] || nil
@prefill_token = opts[:prefill_token]
I18n.with_locale(record.locale) do
super
end
end
def self.critical_email?(action_name)
true
end
2018-05-14 14:21:03 +02:00
end