[英]How to customize the Meteor accounts verification email template?
How to customize meteor account email templates? 如何自定义流星帐户电子邮件模板? In Meteor startup I have:
在Meteor启动中,我有:
Accounts.config({
sendVerificationEmail: true
});
Is there a way to configure email template? 有没有配置电子邮件模板的方法? For example, there is a verification link in email, I have to change the link into button.
例如,电子邮件中有一个验证链接,我必须将链接更改为按钮。
You can customise the verifyEmail
component by using the following function: 您可以使用以下功能来自定义
verifyEmail
组件:
Accounts.emailTemplates.verifyEmail.text = function(user, url) {
return 'Your custom text, URL:' + url;
};
Since you want to change the link, you may want to use: 由于您要更改链接,因此您可能需要使用:
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>';
};
Read more about Accounts.emailTemplates
. 了解有关
Accounts.emailTemplates
更多信息。
Just to bring more light on this. 只是为了使更多的了解。
Accounts.emailTemplates.verifyEmail = {
subject() {
return "Activate your account now!";
},
text(user, url) {
return 'Hey ' + user.profile.name
+ '! Verify your e-mail by following the link below:\n\n'
+ url;
}
};
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.