[英]FosUserBundle Confirm Email after registration
我想在每次在我的网站上注册新用户后都进行电子邮件确认,因此注册完成后,系统必须将他重定向到另一个页面,该页面告诉他应该确认他的电子邮件地址,并且仅授予其拥有激活的邮件地址。
我的配置文件是:
fos_user:
db_driver: orm # other valid values are 'mongodb' and 'couchdb'
firewall_name: main
user_class: AppBundle\User
registration:
confirmation:
from_email: # Use this node only if you don't want the global email address for the confirmation email
address: test@example.com
sender_name: Example sender
enabled: true # change to true for required email confirmation
template: '@FOSUser/Registration/email.txt.twig'
这是我得到的错误:
类型错误:传递给FOS \\ UserBundle \\ EventListener \\ EmailConfirmationListener :: onRegistrationSuccess()的参数1必须是FOS \\ UserBundle \\ Event \\ FormEvent的实例,是FOS \\ UserBundle \\ Event \\ GetResponseUserEvent的实例
EmailConfirmationListener onRegistrationSuccess必须是FormEvent的实例
您尝试实现的是默认情况下发生的事情。 似乎您更改了事件监听器或制作了一个无效的事件监听器。 另外,在您的配置文件中,“ template:”似乎不在正确的位置,因为它与“ enabled”和“ from_email”不匹配。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.