Reputation: 7735
i get no such email for user when calling
Accounts.sendVerificationEmail(user._id);
i'm using accounts-meld to create user out of social accounts . it seems the user doesn't have the apropriate email field .
here' my user structure :
{ createdAt: Fri Feb 27 2015 18:41:45 GMT+0000 (UTC),
_id: 'WqQwxMNjkj2',
services:
{ google:
I20150227-18:41:45.115(0)? { accessToken: 'dsqfdfsdf',
expiresAt: 1425066104902,
id: '117265302061982152409',
email: '[email protected]', verified_email: true,
name: 'john',
given_name: 'own',
family_name: 'Fafa',
picture: '',
locale: 'en',
gender: 'male' } } }
Upvotes: 0
Views: 204
Reputation: 533
I'm adding "Resend Verification Email" functionality and like you if I try calling:
Accounts.sendVerificationEmail(user._id, function(error) {...});
I'm getting the error No such email address for user
. And I can clearly see the email address at user.emails[0].address
. I think this might be a bug because if you call:
Accounts.sendVerificationEmail(user._id, user.emails[0].address, function(error) {...});
It works.
The documentation says about the email parameter: "Optional. Which address of the user's to send the email to. This address must be in the user's emails list. Defaults to the first unverified email in the list."
So I'm going to report this as a bug.
EDIT: It's not a bug. The Accounts.sendVerificationEmail
function doesn't take a callback - it's synchronous. So when you pass it a callback it thinks that's the optional email address to send the email to - hence the error.
Source: https://github.com/meteor/meteor/issues/5081#event-398306740
Upvotes: 1