0

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

4

1 回答 1

1

您的代码说onCreate而不是onCreateUser。也许这是一个错字?还要确保它正在返回一个user文件。您始终可以添加一个console.log来测试是否使用正确的参数调用该函数。

于 2013-05-28T05:26:33.790 回答