title: pass extra instance vars to devise_invitable email template
body: <p>I'm overriding the <code>devise_invitable</code> controller and in my create method I'd like to pass extra values to the <code>invitations_instructions</code> email template. For example group name, has anyone been successful at this, if so please give me some clues here.</p>
  
  <p>what I've tried...</p>
  
  <p>my <code>@group</code> in my <code>Users::InvitesController &lt; Devise::InvitationsController</code> create method is undefined in the email template.</p>
  
  <p>tried to add <code>:skip_invitation =&gt; true</code> in my create and then send the email manually like...</p>
  
  <pre><code>self.resource = resource_class.invite!(params[resource_name], current_inviter, :skip_invitation =&gt; true)
   ::Devise.mailer.invitation_instructions(self.resource).deliver
  </code></pre>
  
  <p>but this gives the wrong number of arguments so there is something I'm not reading correctly from the documentation.</p>
  
  <p>UPDATE - possible solution</p>
  
  <p>The only way appears to be this, but I'm curious if there is a better way that uses the templates provided and devise mailer</p>
  
  <p>in my <code>/app/controller/users/InvitesController#create</code>
  (inherits from <code>InvitationsController</code>)  </p>
  
  <pre><code>self.resource = resource_class.invite!(params[resource_name], current_inviter) do |u|
    u.skip_invitation = true
  end
  UserMailer.invitation_instructions(self.resource, current_inviter, @object).deliver
  </code></pre>
  
  <p>where <code>UserMailer</code> is my general (standard) action mailer and goes something like...</p>
  
  <pre><code>def invitation_instructions(resource, inviter, object)
      @resource = resource
      @object = object
      @inviter = inviter
  
      mail(:to =&gt; resource.email, :subject =&gt; 'New invitation from ' + inviter.first_name)
    end
  </code></pre>