Does email verification work out of the box?

I was just figuring this out last week for my app. You need to configure accounts:

Accounts.config({sendVerificationEmail: true, forbidClientAccountCreation: false});
Accounts.emailTemplates.siteName = "YourAppName";
Accounts.emailTemplates.from     = "YourAppName <support@YourAppName.com>";
Accounts.emailTemplates.verifyEmail = {
    subject() {
        return "[YourAppName] Verify Your Email Address";
    },
    text( user, url ) {
        let emailAddress   = user.emails[0].address,
            urlWithoutHash = url.replace( '#/', '' ),
            supportEmail   = "support@YourAppName.com",
            emailBody      = `To verify your email address (${emailAddress}) click the following link:\n\n${urlWithoutHash}\n\n If you did not request this verification, please ignore this email. If you feel something is wrong, please contact our support team: ${supportEmail}.`;

        return emailBody;
    }
};

I have that in my server startup code. Note the urlWithoutHash code – this replaces the hash sign in the URL, which is essential. I am using Meteor accounts, but not accounts-ui – I’ve built my own accounts user interface using Material-UI.

1 Like

ping @sashko, maybe this sd be clarified in the Guide?..

1 Like

I would add that this info needs to preface all the other documentation in the email verification workflow part of the accounts docs.
It’s the mechanism needed to engage all the following functionality.
I only just now found it here.

Some conceptual/architectural overview would help a lot