I have some questions about sending verification email and popup dialogs.
I'm using iron-router, accounts-* packages/
To change the verification email follow the template used at : https://github.com/meteor/meteor/blob/devel/packages/accounts-password/email_templates.js
E.g (taken from the url above), there's lots to customise.
Accounts.emailTemplates.verifyEmail = {
subject: function(user) {
return "How to verify email address on " + Accounts.emailTemplates.siteName;
},
text: function(user, url) {
var greeting = (user.profile && user.profile.name) ?
("Hello " + user.profile.name + ",") : "Hello,";
return greeting + "\n"
+ "\n"
+ "To verify your account email, simply click the link below.\n"
+ "\n"
+ url + "\n"
+ "\n"
+ "Thanks.\n";
}
}
To register don't use Accounts.createUser
on the client side. Use a method/call to proxy your message to the server
Client side
Meteor.call("registerMe", username, password, function(err, result) {
});
Server Side:
Meteor.methods({
registerMe: function(username, password) {
return Accounts.createUser({username: username, password: password});
}
});
You can customize accounts-ui stuff by removing accounts-ui from your project and adding in an unstyled one, followed by adding in styles seperately
meteor remove accounts-ui
meteor add accounts-ui-unstyled
meteor add less
Then use the .less
file at https://github.com/meteor/meteor/blob/devel/packages/accounts-ui/login_buttons.less into your project and customize it to your preferences.
Accounts.validateLoginAttempt(function(type){
if(type.user && type.user.emails && !type.user.emails[0].verified )
throw new Meteor.Error(100002, "email not verified" );
return true;
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With