【问题标题】:check if email has been sent from fos_userBudle检查是否已从 fos_userBudle 发送电子邮件
【发布时间】:2016-04-23 20:14:44
【问题描述】:

我为我的用户使用了很棒的 fos_userbundle,我可以说它工作得很好,但是当我想通过命令创建我的用户时,需要单击电子邮件中的链接进行激活,有时会显示成功消息但电子邮件未发送。那么如何检查电子邮件是否已发送。 笔记: - 在我的用户表单界面上效果很好。 - 我使用 FOSUserBundle dev-master 、 SF 2.8 、 Ubuntu OS 和 gmail 帐户。 谢谢。

【问题讨论】:

    标签: symfony email fosuserbundle


    【解决方案1】:

    使用此命令时:

    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

    当您想在通过命令创建用户后发送激活电子邮件时,您应该覆盖已经存在的命令。在下面的链接中有一些有用的信息。

    Override symfony2 console commands?

    【讨论】:

      猜你喜欢
      • 2011-09-22
      • 2017-07-09
      • 2012-08-29
      • 1970-01-01
      • 2018-04-09
      • 1970-01-01
      • 2011-11-24
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多