Resending verify email

I have been running an app for a few weeks. I have gotten 2000 users but I realized that the email verification system was not setup properly. I finally fixed the issue but now I have a ton of users that haven’t verified their email addresses. I was wondering if there is a way to mass send all of them their verification email?

You could just step through the user collection and send a new email, but with 2000 I would recommend using SendGrid as they will tell you which emails get delivered, junk etc.

I am using mailgun. It looks like a good majority were sent its just that they were sent with “meteor accounts” instead of my app name. Probably confused people.

Out of interest -With 2000 users - could you give some details about your deployment and how you rate it?

Using digital ocean with mup and compose. 2000 users is total and I can have about 150 using at one time on 8gb. I am a new coder but I think I can improve it. I have had a pretty good experience with all services. It’s hard for me to judge because I haven’t really used any other services. I chose d.o. because it was much cheaper than modulus.

WOW! I am really impressed - 2000 users in just a few weeks is exceptional, and it looks good for Digital Ocean too if it can handle 150 users at the same time. Care to put a link to the website?

Forgot to say have a look at gliese:pretty-email it does a formatted verification email which looks a lot better than the standard one from Meteor.

Yeah I have added that. I guess I am hoping for a way to mass send the verify email to those who havent yet.

I am hoping for a way to mass send the verify email to those who havent yet.

Here is some code which works in the server:

var testdata = Meteor.users.find({});
testdata.forEach(function(item){
  if (!item.emails[0].verified) {
    console.log(item._id, item.name);
    Accounts.sendVerificationEmail(item._id);}
});

I have not been able to test it in terms of actually sending the email as my system is currently down.
I would suggest putting it in a Meteor method which you could call as required.
It also needs testing - replace the line:

 var testdata = Meteor.users.find({});

with a known user id so that you can make sure the email is sent as expected.

 var testdata = Meteor.users.find({_id:12456458});

Once you are happy that the email is being sent correct - and clicking on the link does verify the user - you could send the emails out in bulk - but I would limit the number of emails sent at any one time as sending 2000 odd as once may end up as being flagged as junk and blocked by the email system.

1 Like

Thanks for responding. I guess I thinking other people would of had this problem and would be included into the package. Thanks for this!