Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/meteor/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Meteor 使用谷歌账户、facebook账户验证电子邮件_Meteor_Verification_Google Account - Fatal编程技术网

Meteor 使用谷歌账户、facebook账户验证电子邮件

Meteor 使用谷歌账户、facebook账户验证电子邮件,meteor,verification,google-account,Meteor,Verification,Google Account,我有一个正在运行的应用程序,在创建电子邮件/帐户名时发送验证电子邮件,但如果我使用google/facebook登录,它不会发送验证电子邮件;这可能是由于服务中的电子邮件地址。google.email;如果Accounts.emailTemplates中存在字段“to”,如何将其设置为 configureAccounts = function() { setMailVerification(enableMailVerification); }; setMailVerification

我有一个正在运行的应用程序,在创建电子邮件/帐户名时发送验证电子邮件,但如果我使用google/facebook登录,它不会发送验证电子邮件;这可能是由于服务中的电子邮件地址。google.email;如果Accounts.emailTemplates中存在字段“to”,如何将其设置为

configureAccounts = function() {
    setMailVerification(enableMailVerification);
};

setMailVerification = function() {
    Accounts.emailTemplates.from = 'myEmail@.com';
    Accounts.emailTemplates.verifyEmail = {
        subject : function(user) {
            return "Confirmation"
        },
        text : function(user, url) {
            var greeting = (user.profile && user.profile.nick) ? ("Hello " + user.profile.nick + ",") : "Hello,";
            return greeting + 
                "\n\n"  + "Thank you for registration."+
                "\n"    + "To confirm click the following link:" + url +
                "\n\n"  + "thank you."
        }
    };

    Accounts.config({
        sendVerificationEmail : true,
        forbidClientAccountCreation : false
    });
};
请让我知道你是否应该把…services.google.email放在哪里,以防谷歌登录,facebook也是如此


换句话说,我如何向Meteor.user().services.google.email发送验证电子邮件。。(即使使用该电子邮件调用sendUserVerificationEmail也不起作用,因为它不在“电子邮件”中)

我修改了CreateUser的.email属性,如下所示:

if(user.services != undefined) {
    console.log('services in onCreateUser');
    user.sentVerificationEmail = false;
    user.emails =[];

    var emailServices = user.services.google != undefined ?
        user.services.google.email :
        user.services.facebook.email;
    user.emails.push({
        address : emailServices,
        verified : false
    });
}

if (options.profile)
    user.profile = options.profile;

return user;
我先打电话给Accounts.sentVerificationEmail然后再登录。。它成功了


感谢大家查看我修改的。CreateUser的电子邮件属性如下:

if(user.services != undefined) {
    console.log('services in onCreateUser');
    user.sentVerificationEmail = false;
    user.emails =[];

    var emailServices = user.services.google != undefined ?
        user.services.google.email :
        user.services.facebook.email;
    user.emails.push({
        address : emailServices,
        verified : false
    });
}

if (options.profile)
    user.profile = options.profile;

return user;
我先打电话给Accounts.sentVerificationEmail然后再登录。。它成功了

谢谢大家看一看