Skip to content

Instantly share code, notes, and snippets.

@mariiillo
Created May 20, 2015 21:13
Show Gist options
  • Select an option

  • Save mariiillo/92c06346923d2e078e5f to your computer and use it in GitHub Desktop.

Select an option

Save mariiillo/92c06346923d2e078e5f to your computer and use it in GitHub Desktop.
Devise Custom Mailer
/mailers/devise/custom_mailer.rb
class Devise::CustomMailer < Devise::Mailer
def headers_for(action, opts={})
super.tap do |hash|
hash.merge!({
:subject => 'Subject',
:from => 'QWE',#mailer_sender(devise_mapping),
:to => 'ASD',#resource.email,
:cc => 'ZXC',#resource.backup_user_email(action),
:template_path => template_paths }) if action == :invitation_instructions
end
end
end
initializers/devise.rb
config.mailer = "Devise::CustomMailer"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment