/imports/api/users/methods.js
import { Meteor } from 'meteor/meteor';
Meteor.methods({
'Users.sendVerificationLink'() {
let userId = Meteor.userId();
if ( userId ) {
return Accounts.sendVerificationEmail( userId );
}
}
});
And here’s where I’m calling the method:
/imports/ui/pages/RegisterPage.jsx
import React from 'react';
import { Meteor } from 'meteor/meteor';
export default class RegisterPage extends React.Component {
signupWithEmail(event) {
Accounts.createUser(user, (error) => {
if (error) {
sweetAlert("Oops...", error, "error");
} else {
Meteor.call('Users.sendVerificationLink', (error, response) => {
if (error) {
sweetAlert("Oops...", error, "error");
} else {
sweetAlert("Welcome", "Your account is complete!", "success");
}
});
}
});
event.preventDefault();
}
}
Is this a load order issue? I’m sure it’s related to that or something, any ideas guys?
I’m getting this error message:
Method ‘Users.sendVerificationLink’ not found [404]