Skip to content

Instantly share code, notes, and snippets.

@elbuo8
Created May 28, 2013 05:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save elbuo8/5660629 to your computer and use it in GitHub Desktop.
Save elbuo8/5660629 to your computer and use it in GitHub Desktop.
@invite = (email, agencyId, callback) ->
(app.get 'users').findOne {email: email}, (error, existingUser) ->
if existingUser
(app.get 'users').update {_id: existingUser._id},
{$addToSet:{agencies:agencyId}}, (error) ->
addToTeam agencyId, existingUser._id, (error) ->
console.log 'here'
app.EmailHandler.invite email, agencyId, ->
callback()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment