【问题标题】:firebase - email authentication mail does not have %DISPLAY_NAME%,firebase - 电子邮件身份验证邮件没有 %DISPLAY_NAME%,
【发布时间】:2017-08-10 05:47:24
【问题描述】:

我现在一直在研究 angularJS 和 firebase。

使用以下代码在我的网站注册后会发出一封电子邮件:

regUser.sendEmailVerification();

firebase.google.com 上此电子邮件的消息显示

您好 %DISPLAY_NAME%, 按照此链接验证您的电子邮件地址。

但是我在注册后收到的电子邮件中显示的消息

你好, 按照此链接验证您的电子邮件地址。

它不显示 %DISPLAY_NAME% 。这里有什么问题?难道我做错了什么?

【问题讨论】:

  • 在这种情况下,用户似乎没有显示名称。
  • 如何在此处添加显示名称?我尝试使用 regUser.setDisplayName(user.firstname) 但这不起作用。

标签: angularjs firebase firebase-authentication


【解决方案1】:

您必须使用regUser.updateProfile(...) 到update the user's profile。这允许您设置displayName:

regUser.updateProfile({
  displayName: "Jane Q. User",
  photoURL: "https://example.com/jane-q-user/profile.jpg"
}).then(function() {
  regUser.sendEmailVerification();
}).catch(function(error) {
  // An error happened.
});

【讨论】:

    猜你喜欢
    • 2021-10-05
    • 2023-03-18
    • 2018-02-10
    • 2021-12-08
    • 2021-03-26
    • 1970-01-01
    • 2020-11-22
    • 2019-05-20
    • 2021-11-21
    相关资源
    最近更新 更多