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.

Revisions

  1. mariiillo created this gist May 20, 2015.
    15 changes: 15 additions & 0 deletions custom_mailer.rb
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,15 @@
    /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
    3 changes: 3 additions & 0 deletions devise.rb
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,3 @@
    initializers/devise.rb

    config.mailer = "Devise::CustomMailer"