how to set sender_name for the controller Resetting in FOSUserBundle?

余生颓废 提交于 2019-12-24 02:14:09

问题


I want to change the name of the sender_name of the email during the resetting. I already have done this while registration and it was successful. This was done easily by defining fos_user.registration.confirmation.from_email.sender_name.

Now, I am wondering to do the same thing for resetting, but no email was sent. If I delete the configuration of resetting (as seen below), the email is sent!

fos_user:
    db_driver: orm 
    firewall_name: main
    user_class: Minn\UserBundle\Entity\User
    registration:
        form:
            type: minn_user_registration 
        confirmation:
            enabled:    true 
            template:   MinnUserBundle:Registration:email.txt.twig        
            from_email:
                address: %the_address%
                sender_name: %the_name% 
    resetting:
        token_ttl: 86400
        email:
            from_email:
                address:        %the_address%
                sender_name:    %the_name% 
    service:
        mailer:  fos_user.mailer.twig_swift

So, any idea? Thanks


回答1:


Solution found!

I just forgot to specify fos_user.resetting.form.* as seen below...

fos_user:
    db_driver: orm 
    firewall_name: main
    user_class: Minn\UserBundle\Entity\User
    registration:
        form:
            type: minn_user_registration 
        confirmation:
            enabled:    true 
            template:   MinnUserBundle:Registration:email.txt.twig        
            from_email:
                address: %the_address%
                sender_name: %the_name% 
    resetting:
        token_ttl: 86400
        email:
            from_email:
                address:        %the_address%
                sender_name:    %the_name% 
        form:
            type:               fos_user_resetting
            name:               fos_user_resetting_form
            validation_groups:  [ResetPassword, Default]  
    service:
        mailer:  fos_user.mailer.twig_swift

Hope it will help others...



来源:https://stackoverflow.com/questions/25980145/how-to-set-sender-name-for-the-controller-resetting-in-fosuserbundle

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!