 jraphical = require 'jraphical'
 Bongo     = require "bongo"
 
-{secure, daisy, Base} = Bongo
+{secure, daisy, Base, signature} = Bongo
 
 module.exports = class JInvitation extends jraphical.Module
 

      }
      invite.save callback

  @sendResurrectionEmails = permit 'send invitations',
    success: (client, username, callback)->
      JInvitation.some {group:"resurrection", status:"active"}, {}, (err, invites)=>
        daisy queue = invites.map (invite) =>
          =>
            email = new JMail {
              email   : invite.email
              subject : "You're invited to try a new version Koding!"
              content : @getRessurrectionMessage invite.code
              replyto : "hello@koding.com"
            }
            email.save (err)->
              invite.update {$set: status: if err then 'couldnt send email' else 'sent'}, ->

        queue.push -> callback null

  @suggestCode: permit 'send invitations',
    success: (client, callback, tries=0)->
      return callback 'could not generate code, too many tries!'  if tries > 10


  @isEnabledGlobally = yes

  {ObjectRef, dash, daisy, secure, signature} = require 'bongo'

  KodingError = require '../error'
  JMail       = require './email'
