title: Pass variable from Devise controller to custom mailer?
body: <p>I use Devise for authentication in my Rails app.</p>
  
  <p>In my <code>registrations_controller</code> I have a variable like this:</p>
  
  <pre><code>class RegistrationsController &lt; Devise::RegistrationsController
    def create
      foo = "bar"
      super
    end
  end
  </code></pre>
  
  <p>In my customized mailer I then try to access the <code>foo</code> variable. The <code>opts</code> argument seems to be the one to look at:</p>
  
  <pre><code>class CustomMailer &lt; Devise::Mailer
    helper :application
    include Devise::Controllers::UrlHelpers
  
    def confirmation_instructions(record, token, opts={})
      Rails.logger.error opts[:foo].inspect
      super
    end
  end
  </code></pre>
  
  <p>But how do I pass on the <code>foo</code> variable on, without overwriting a lot of methods?</p>