设计软电子邮件确认 [英] Devise Soft Email Confirmation

查看:89
本文介绍了设计软电子邮件确认的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个使用Devise和可确认模块的rails 3应用程序。但是,防止新注册的用户访问该网站,直到确认其电子邮件是导致保留问题。相反,我们希望立即授予对用户的访问权限,而仍然向他们发送确认电子邮件。然后,我们将执行一个后台任务来锁定在一段固定的时间内未确认电子邮件的用户。

I have a rails 3 application that uses Devise and the confirmable module. However, preventing newly registered users from accessing the the site until they confirm their email is causing retention problems. Instead, we would like to instantly grant access to the user and still send them a confirmation email. We would then run a background task to lock out user's who have not confirmed their email within a fixed period of time.

可确认的模块是否可能?有没有办法仍然创建一个活动资源(用户)谁没有确认他们的电子邮件与可确认的模块?关于实现这一点的任何一般建议?

Is this possible with the confirmable module? Is there a way to still create an active resource (user) who hasn't confirmed their email with the confirmable module? Any general advice on implementing this?

推荐答案

我相信可以使用confirm_within来指定锁定约束。您可以在调用devise_for时启用此功能。

I believe you can use confirm_within to specify a lockout constraint. You can enable this when you call devise_for.

http://rubydoc.info/github/plataformatec/devise/master/Devise/Models/Confirmable

另外,你可以通过检查确认来选择限制某些行为仅确认用户?用户模型的状态。您可以在控制器中执行此操作,也可以使用CanCan或其他任何操作。您网站上的某些任务可能不需要确认;当用户与其他人交互或可以使用您的网站发送某些通知/电子邮件等时,您可能需要更多的信息。

Also, you can choose to constrain certain behaviors "only" to confirmed users by checking the confirmed? status of your user model. You could do this in the controller, or using CanCan, or whatever. Some tasks on your site probably don't require confirmation; you probably need this more when the user interacts with other people or can use your site to send certain notifications/emails, etc.

这篇关于设计软电子邮件确认的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆