簡體   English   中英

如何自定義Meteor帳戶驗證電子郵件模板?

[英]How to customize the Meteor accounts verification email template?

如何自定義流星帳戶電子郵件模板? 在Meteor啟動中,我有:

Accounts.config({
  sendVerificationEmail: true
});

有沒有配置電子郵件模板的方法? 例如,電子郵件中有一個驗證鏈接,我必須將鏈接更改為按鈕。

您可以使用以下功能來自定義verifyEmail組件:

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

由於您要更改鏈接,因此您可能需要使用:

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>';
};

了解有關Accounts.emailTemplates更多信息。

只是為了使更多的了解。

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;
    }
 };

基於docs中的示例。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM