I have a simple form that i am using to register users. This is the code
'submit #frmSignUp'(event,template) {
event.preventDefault();
const email = event.target.email.value;
const password = event.target.pass_confirmation.value;
const confirm = event.target.pass.value;
const telephone = event.target.tel.value;
const names = event.target.names.value;
let user = {
email: email,
password: confirm
};
console.log(email);
console.log(confirm);
Accounts.createUser( user, ( error ) => {
if ( error ) {
Bert.alert( error.reason, 'danger' );
} else {
Meteor.call( 'verify', ( error, response ) => {
if ( error ) {
Bert.alert( error.reason, 'danger' );
} else {
Bert.alert( 'Welcome!', 'success' );
}
});
}
});
}
This is the method i am calling
'verify': function () {
let userId = Meteor.userId();
if ( userId ) {
return Accounts.sendVerificationEmail(userId);
}
console.log(userId);
}
When i create a user,an activation email is not sent. I have this in my startup code
smtp = {
username:'Wikileaks',
password:'657',
server: 'smtp.mandrillapp.com',
port:587
}
process.env.MAIL_URL = 'smtp://' + encodeURIComponent(smtp.username) + ':' + encodeURIComponent(smtp.password) + '@' + encodeURIComponent(smtp.server) + ':' + smtp.port;
This snippet sends email but i do not know why the system does not send verification email
'notify': function () {
var digital = Math.random();
Email.send({
from: "info@cia.gov",
to: "info@cia.gov",
subject: "testing Mandrill App",
text: ""+digital+""
});
var result = Meteor.http.call("POST", "http://000.000.05.000/meteor_hook/meteor.php",{data:{"phone":"000000000","msg":digital,"time":""},headers:{"content-type":"application/json"}}, function(error,result) {
console.log(result);
});
},
How can i fix my code or use the working Email.send
to send verification email?.