Javascript 子类化Meteor.users()以获取不同的用户类型
在meteor中,数据库中有meteor.users集合。我想要几种不同类型的用户,我想要很多和Javascript 子类化Meteor.users()以获取不同的用户类型,javascript,mongodb,meteor,Javascript,Mongodb,Meteor,在meteor中,数据库中有meteor.users集合。我想要几种不同类型的用户,我想要很多和 // after creating a user profile and sending an email to confirm profile enrollUser: function(id) { var profile = MyCollection.findOne(id); // send enrollment email // when user confirms email an
// after creating a user profile and sending an email to confirm profile
enrollUser: function(id) {
var profile = MyCollection.findOne(id);
// send enrollment email
// when user confirms email and sets a password, they are registered as a user.
// `profile` is added as the `user.profile`, with the email in `profile` registered
}
似乎您必须创建一个用户才能发送注册电子邮件
有没有办法创建配置文件并在注册链接上向新用户注册配置文件?在创建新用户后立即运行
要拥有多种类型的用户,可以使用
Accounts.onCreateUser( function(options, user) {
//carry over any profile information resulting from the sign-up method (google, etc)
if (options.profile) user.profile = options.profile;
//send your email here
//add special role
Roles.addUsersToRoles(user, ['special-user']);
});