title: How do I set a custom email subject in a custom Devise email?
body: <p>I am using Devise in a Rails 3 application to create accounts.  I have different types of users, so I want to send out custom password recovery emails based on the type of user.</p>
  
  <p>I am able to send the custom email, I haven't found a way to set custom headers on that email.  I am particularly interested in setting the subject of the email.</p>
  
  <p>I have done the following:</p>
  
  <ul>
  <li>Created a custom Devise mailer with a custom method inside.  This method calls devise_mail with parameters.  In this case, the custom mailer is called "reset_partner_instructions".  I am able to call this mailer and successfully send an email from my User model.</li>
  <li>Created a custom email view template which is successfully being called from <code>devise_mail</code>.</li>
  </ul>
  
  <p>My custom mailer looks like this:</p>
  
  <pre><code>class AccountMailer &lt; Devise::Mailer
    helper :application # gives access to all helpers defined within application_helper.
    def reset_partner_instructions(record, opts={})
      devise_mail(record, :reset_partner_instructions, opts)
    end
  end
  </code></pre>
  
  <p>The problem is that the subject of the email is always "Reset partner instructions".  I believe Devise is generating this title from the name of the mail template.</p>
  
  <p>In this tutorial <a href="https://github.com/plataformatec/devise/wiki/How-To:-Use-custom-mailer" rel="noreferrer">https://github.com/plataformatec/devise/wiki/How-To:-Use-custom-mailer</a>, they call the following code:</p>
  
  <pre><code>def confirmation_instructions(record, opts={})
    headers["Custom-header"] = "Bar"
    super
  end
  </code></pre>
  
  <p>Since I'm calling "devise_mail" directly, I'm not seeing how to pass the headers intoto the mailer.  Is there a simple setting or method I can use to set the email subject?</p>