简体   繁体   English

Laravel4 Sentry2电子邮件激活

[英]Laravel4 Sentry2 email activation

I am using Laravel4 and the Sentry2 package. 我正在使用Laravel4和Sentry2软件包。

I have a user registering and logging in successfully but I need help sending the email activation. 我有一个成功注册和登录的用户,但是我需要发送电子邮件激活的帮助。

My plan is to send an email with a link containing the users email and their activation code. 我的计划是发送一封包含链接的电子邮件,其中包含用户电子邮件及其激活代码。 The user will then be routed to a point where I can check this code in the URL vs the one in the database. 然后,用户将被路由到一个位置,在这里我可以检查URL中的此代码与数据库中的代码。 Does this sound correct? 这听起来正确吗?

Thank you. 谢谢。

Yes, this is correct. 是的,这是正确的。 The typical user registration flow is: 典型的用户注册流程为:

  1. User registers with username, password, email. 用户使用用户名,密码,电子邮件进行注册。
  2. CMS sends email with a random key (which is also stored on the user row). CMS使用随机密钥发送电子邮件(该密钥也存储在用户行中)。
  3. User goes to their email to click activation link that contains the random key (and sometimes user id) in the URL. 用户转到其电子邮件以单击激活链接,该链接包含URL中的随机密钥(有时还包括用户ID)。
  4. CMS detects "user activation" link, takes the activation link and user ID and checks it against the database where "user is not active". CMS检测到“用户激活”链接,获取激活链接和用户ID,并对照“用户未激活”的数据库进行检查。
  5. If found, set the user row to "user is active" and delete the activation key column. 如果找到,请将用户行设置为“用户处于活动状态”,然后删除激活密钥列。
  6. (Optional) send welcome email. (可选)发送欢迎电子邮件。
  7. Prompt for user login. 提示用户登录。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM