如何绕过激活邮件

我通过 API 创建了一个用户并将 activate 设置为 true,在管理控制台查看该用户时,显示用户已激活。

但当我尝试以该用户身份登录时,系统提示:

您暂时无法登录。我们之前已向您发送了一封激活邮件至 user@email.com。请按照该邮件中的说明激活您的账户。

为什么会这样?我本想避免这种情况,是否有设置可以忽略此要求?

我希望忽略这一步,因为我只是将旧论坛的现有用户迁移到新的 Discourse 论坛,要求他们再次激活似乎是不必要的麻烦。我完全理解这对于刚刚注册的新用户来说是必要的。

此外,目前我只是在测试创建一个用户,但将来可能会创建 5000 个用户。这样做可能不正确,我可能需要重新运行迁移,因此目前我根本不希望发送任何邮件,直到准备好正式上线。是否可以禁用邮件发送功能?

You might try to deactivate and then activate again. I’ve seen before that creating and activated user with the API doesn’t work.

Once a user is deactivated, they’ll have to reactivate their account via email. So this would still require an “effort” on their part.

When users from an old forum moved to our current forum, everything was via the invite email and no one complained. Most filled out their profiles except a few. The “hardest” part was getting them to do their profiles/bios. I think it would easier on you to just let your users go through the steps that are already set up - click on email link, set up their account… done. Just remind them they’ll probably have to change their username from the default that Discourse assigns (everything before the @ in their email address).

Here’s how I did it in Feb 2018:

谢谢,这确实奏效了。看起来,创建用户时将 activate 设为 true 意味着不会发送邮件,但同时也无法正确激活。因此,当你首次尝试登录时,系统会提示你已发送激活邮件,但实际上并没有。不过,我可能理解有误。

但先停用再启用,可以让你首次登录时无需激活,且不会发送邮件,这正是我想要的效果。