如何自定义Meteor帐户验证邮件模板?

Ram*_*san 1 javascript meteor meteor-accounts

如何自定义流星帐户电子邮件模板?在Meteor初创公司,我有:

Accounts.config({
  sendVerificationEmail: true
});
Run Code Online (Sandbox Code Playgroud)

有没有办法配置电子邮件模板?例如,电子邮件中有一个验证链接,我必须将链接更改为按钮.

Mat*_*art 9

您可以verifyEmail使用以下函数自定义组件:

Accounts.emailTemplates.verifyEmail.text = function(user, url) {
    return 'Your custom text, URL:' + url;
};
Run Code Online (Sandbox Code Playgroud)

由于您想要更改链接,您可能希望使用:

Accounts.emailTemplates.verifyEmail.html = function(user, url) {
    /* Return your HTML code here: */
    return '<h1>Thank you for your registration.</h1><br/><a href="' + url + '">Verify eMail</a>';
};
Run Code Online (Sandbox Code Playgroud)

了解更多Accounts.emailTemplates.