Hi guys. I am having issues Creating users on Meteor 1.3.5.0. In my server/mail.js
I have this code
Meteor.startup(function() {
process.env.MAIL_URL = "smtp://sender%40domain.com:pass%40example@smtp.example.com:465/";
AccountsEntry.config({sendVerificationEmail: true});
Accounts.emailTemplates.siteName = "Sender";
Accounts.emailTemplates.from = "Sender<sender@example.com>";
Accounts.emailTemplates.verifyEmail = {
subject() {
return "[SenderName] Verify Your Email Address";
},
text(user, url) {
let emailAddress = user.emails[0].address,
urlWithoutHash = url.replace('#/', ''),
supportEmail = "sender@domain.com",
emailBody = `To verify your email address
(${emailAddress}) visit 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;
}
};
});
my code to createUser
in (client/signup.js) is :
Accounts.createUser({
email: userData.email,
password: userData.password,
username: userData.username,
}, function (error) {
if (error) {
let errorDiv = $('#login-error.alert.alert-danger');
errorDiv.html("Login Error: "+error.reason+"<br>Did you <a href='#' data-toggle='modal' data-dismiss='modal' data-target='#forgotPasswordModal'>Forget Your password</a>? or Try another email address").show();
setTimeout(function(){
errorDiv.hide();
}, 5000);
toastr.error(
"",
"ERROR: " + error.reason
);
return false;
} else {
Meteor.call('createProfileField', Meteor.userId(), profile, function(error, response){
if(error){
toastr.error(error.reason, 'Error');
return false;
}else{
$('#signupModal').modal('toggle');
$('.modal-backdrop').hide();
Roles.addUsersToRoles(Meteor.userId(), ['employee'])
toastr.success("Your registration was successful, You are now logged in.");
Router.go(currentPage)
}
});
}
})
This creates the user but throws an error
Exception while invoking method ‘createUser’ Error: getaddrinfo ENOTFOUND
What seems to be the problem please? Thanks