title: Devise how to pass current_user to confirm_instructions mailer
body: <p>I have Devise set up and woking great. I am using confirmable and have modified this as per their 2 step registration process guide:</p>
  
  <p><a href="https://github.com/plataformatec/devise/wiki/How-To%3a-Override-confirmations-so-users-can-pick-their-own-passwords-as-part-of-confirmation-activation" rel="noreferrer">set password at confirmation</a></p>
  
  <p>I have one last requirement that I am having trouble with. </p>
  
  <p>What we have is a 2 scenarios </p>
  
  <p>1) a user can register as new </p>
  
  <p>2) A logged in user (current_user) can create a new user. 
  When a logged in user creates a new user I want to be able to add their email into the confirmation email sent to the new created user</p>
  
  <p>In the email to the new registered user I need to pass in the current_user.email somehow if the user was created by a user one logged in. I will then do a simple if check and add some extra text to the email.</p>
  
  <p>the confirmation_instructions.html.erb currently:</p>
  
  <pre><code>&lt;p&gt;Welcome &lt;%= @resource.email %&gt;!&lt;/p&gt;
  
  &lt;p&gt;You can confirm your account email through the link below:&lt;/p&gt;
  
  &lt;p&gt;&lt;%= link_to 'Confirm account', confirmation_url(@resource, :confirmation_token =&gt; @resource.confirmation_token) %&gt;&lt;/p&gt;
  </code></pre>
  
  <p>What I need is something like</p>
  
  <pre><code>&lt;p&gt;Welcome &lt;%= @resource.email %&gt;!&lt;/p&gt;
  
  &lt;% if !@user.email.nil? %&gt;
     &lt;p&gt; some additional welcome text here from &lt;%= @user.email %&gt; &lt;/p&gt;
  &lt;% end %&gt;
  
  &lt;p&gt;You can confirm your account email through the link below:&lt;/p&gt;
  
  &lt;p&gt;&lt;%= link_to 'Confirm account', confirmation_url(@resource, :confirmation_token =&gt; @resource.confirmation_token) %&gt;&lt;/p&gt;
  </code></pre>
  
  <p>I have been going back and forth with custom mailer with no joy.
  Can someone help me out, I am sure there is something simple I am missing here.</p>
  
  <p>For info (I know this is not the best method but we are throwing together a very quick app for demo purposes) a user creates a new contact by typing in am email address. If the email address does not exist in the user table a new user is created then the contact relationship created (snippet of the controller):</p>
  
  <pre><code>class DashboardController &lt; ApplicationController
       before_filter :authenticate_user!
  
    def show
      @contacts = current_user.contacts
    end
  
    def createcontact
      user2 = User.find_by_email(params[:contact_email])
      if user2.nil?
              newContact = User.create(:email =&gt; params[:contact_email])
              if newContact.save
                   current_user.newUserContact(newContact)
                   redirect_to dashboard_path, :notice =&gt; "conact has been saved as well as a new contact"
              else
                  redirect_to dashboard_path, :notice =&gt; "ERROR saving contact"
              end
      else
        .
        .
        .
        .
  </code></pre>