Meteor,关于验证邮件的问题

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文件到您的项目中,并根据您的喜好进行自定义.