问题
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