我为我的用户使用了很棒的fos_userbundle,我可以说它工作得很好但是有一种情况我想从命令创建我的用户,需要点击电子邮件中的链接进行激活,有时会显示成功的消息但是电子邮件未发送。那么如何检查是否发送了电子邮件。 注意: - 在我的用户表单界面上工作正常。 - 我使用FOSUserBundle dev-master,SF 2.8,Ubuntu OS和gmail帐户。 谢谢。
答案 0 :(得分:0)
使用此命令时:
php bin/console fos:user:create testuser test@example.com p@ssword
不会发送电子邮件激活。没有代码负责发送电子邮件。运行此命令时使用的代码:
https://github.com/FriendsOfSymfony/FOSUserBundle/blob/master/Command/CreateUserCommand.php#L69
https://github.com/FriendsOfSymfony/FOSUserBundle/blob/master/Util/UserManipulator.php#L48
https://github.com/FriendsOfSymfony/FOSUserBundle/blob/master/Doctrine/UserManager.php#L93
如果要在按用户命令创建后发送激活电子邮件,则应覆盖现有命令。在下面的链接中有一些有用的信息。