I'm doing account creation without accounts.ui package, just with accounts-base/accounts-password. I have a code on server
side
Accounts.config({
sendVerificationEmail: true,
forbidClientAccountCreation: true // cause we call it from server code
});
Then later on signup form submit I call
Accounts.createUser({User account document where `email` field is set to actual email});
It creates user (I can login with this user later) without an issue or errors except it doesn't send any email messages to me.
I have meteor email package installed and I don't have email URL configured so it supposed to print message in standard output that doesn't happen.
I can use post user create hook and send email manually but I suppose it should work without this additional effort as described in docs.
Meteor version is 1.0.3.1
I'm facing the same issue, however it works on a different project I have. There is a workaround which is using a hook (https://github.com/Meteor-Community-Packages/meteor-collection-hooks).
Add the package with meteor add matb33:collection-hooks
Then import it on the server side import { CollectionHooks } from 'meteor/matb33:collection-hooks';
Finally, in your Meteor.starup you can add the following code:
Meteor.users.after.insert((userId, doc) => {
Accounts.sendVerificationEmail(doc._id);
});
I also tried sending the email verification on Accounts.onCreateUser, but, it seems that the user hasn't been stored in the database yet, hence it fails.
Using Meteor 1.8.3.
UPDATE: After reading the code I found that sendVerificationEmail is valid only when the user registers on the client side (which is not your case and not my case as both of us forbid it).
You can check account_commons.js and check that they have a comment for that:
// - sendVerificationEmail {Boolean}
// Send email address verification emails to new users created from
// client signups.
Now you can continue using your hook in peace.