简体   繁体   English

通过设计确认多封电子邮件

[英]Confirm multiple emails with devise

I am using rails+devise. 我正在使用rails + devise。 I want the user to be able to confirm multiple e-mails (the app would send for each address a mail with a "confirm" link, and then the user have one or many confirmed mails). 我希望用户能够确认多封电子邮件(该应用程序将为每个地址发送一封带有“确认”链接的邮件,然后用户收到一封或多封确认邮件)。 It is possible to confirm one with :confirmable (doc : http://rubydoc.info/github/plataformatec/devise/master/Devise/Models/Confirmable ) 可以用:confirmable来确认一个(doc: http : //rubydoc.info/github/plataformatec/devise/master/Devise/Models/Confirmable

I thought that i could play with 我以为我可以玩

- (Object) resend_confirmation_instructions

by changing the address but this is not the best solution. 通过更改地址,但这不是最佳解决方案。 Is there a solution with devise or do i have to implement this specific functionnality? 是否有专门设计的解决方案,或者我必须实现此特定功能?

You'll have to implement this yourself. 您必须自己实现。 Devise has one email per account, by default. 默认情况下,Devise每个帐户只有一封电子邮件。

You'd not only need to handle multiple emails, but presumably you'd also want multiple confirmation_token 's, along with multiples of the other database fields relating to email confirmation (find them in the devise migration file that gets generated). 您不仅需要处理多封电子邮件,而且大概还需要多个confirmation_token以及与电子邮件确认有关的其他数据库字段的倍数(在生成的devig迁移文件中查找它们)。 I don't imagine this will be a simple thing to solve with devise. 我不认为这将是设计解决简单的事情。

However, this sounds like a counter intuitive thing to do. 但是,这听起来像是要做反直观的事情。 Perhaps you should update your question to include the requirements of your app, and the reason why you need to get confirmation from multiple email addresses. 也许您应该更新您的问题以包括您的应用程序要求,以及需要从多个电子邮件地址获得确认的原因。 Someone may have a solution for how to architect your app such that it doesn't need this feature. 有人可能对如何构建您的应用程序有一个解决方案,使其不需要此功能。

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

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