0
votes

I have been using Meteor for two weeks, I am trying to add functionality to send an email once the user account has been created. I have looked at several tutorials on the Accounts.onCreateUser() function. Here is the code below.

if(Meteor.isClient{
   ....some code here.....
   Accounts.createUser({
      ..... Insert some options ......
   }, function(error){
      ..... some More code here ......
   });
}

if(Meteor.isServer){
   Accounts.onCreate(function(options, user){
      ...... Do the required .......
   });
}

It seems like it is according to the several tutorials that I have been using.

I have tested out the code and but the onCreate for the account is always returning 'Internal server error' and I can't find out a cause for it. Is this the way that I am supposed the Accounts.onCreate() callback for the form?

Also is there a debugging functionality if so I can further track the code down?

Thanks

1

1 Answers

1
votes

Your code says onCreate instead of onCreateUser. Maybe that's a typo? Also make sure it is returning a user document. You can always add a console.log to test if the function is being called with the right parameters.