How to make a link resend verification mail to user from react component


#1

hello everyone, i’m having trouble with writing a onclick event on an anchor to resend verification mail to the user in case one hasn’t received it, here’s my current code that shows no error but nothing happens (by nothing i means it doesn’t show the activation code in the console as it does when a new account is created):

import { Accounts } from 'meteor/std:accounts-ui';

_inside component:_
  reSend = () => {
    if (Meteor.is_server) {
        Accounts.sendVerificationEmail(Meteor.userId())
    }
  }

<a onClick={this.reSend}>Resend e-mail</a>

thanks in advance for your help !!


#2

Since it is a server method, you may want to use a Meteor Method to do this. Also, it is Meteor.isServer, not Meteor.is_server, so that could be tripping you up as well.


#3

using a Meteor Method on a server file and Meteor Call in component worked perfectly! thanks a lot for your help mate =)