non*_*one 5 email meteor iron-router
我有一些关于发送验证电子邮件和弹出对话框的问题.
我正在使用铁路由器,账户 -*包/
Aks*_*hat 15
要更改验证邮件,请按以下网址使用的模板进行操作:https://github.com/meteor/meteor/blob/devel/packages/accounts-password/email_templates.js
例如(取自上面的网址),有很多可定制的.
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";
}
}
Run Code Online (Sandbox Code Playgroud)
注册不要Accounts.createUser在客户端使用.使用方法/调用将消息代理到服务器
客户端
Meteor.call("registerMe", username, password, function(err, result) {
});
Run Code Online (Sandbox Code Playgroud)
服务器端:
Meteor.methods({
registerMe: function(username, password) {
return Accounts.createUser({username: username, password: password});
}
});
Run Code Online (Sandbox Code Playgroud)
您可以通过从项目中删除accounts-ui并添加无样式的内容来自定义account-ui内容,然后单独添加样式
meteor remove accounts-ui
meteor add accounts-ui-unstyled
meteor add less
Run Code Online (Sandbox Code Playgroud)
然后使用https://github.com/meteor/meteor/blob/devel/packages/accounts-ui/login_buttons.less中的.less文件到您的项目中,并根据您的喜好进行自定义.