     # firstName and lastName are optional
     data.firstName = firstName  if firstName
     data.lastName  = lastName   if lastName
+    data.inviter_id = inviter_id
 
     invite = new JInvitation data
     invite.save (err) ->


  createInviteInstance = (options, callback) ->

    { email, groupName, role, firstName, lastName } = options

    JUser = require './user'
    hash  = JUser.getHash email

      role          :
        type        : String
        default     : -> 'member'
      inviter_id    :
        type        : String

  accept$: permit 'send invitations',
    success: (client, callback) ->
