Adib Aroui
Adib Aroui

Reputation: 5067

InvalidConfigurationException: Unrecognized option "email" under "fos_user.registration"

Following the doc, I still cannot find what is the cause behind the following error:

InvalidConfigurationException: Unrecognized option "email" under "fos_user.registration"

My configuration is:

fos_user:
  db_driver: orm
  firewall_name: main
  user_class: Members\Bundle\ManagementBundle\Entity\User
  registration:
        email: 
            template: MembersManagementBundle:Registration:confirmation.html.twig
        confirmation:
            enabled:    true
            from_email:
                address:        [email protected]
                sender_name:    Acme Demo Registration
  service:
        mailer: fos_user.mailer.twig_swift
  resetting:
    email:
        from_email:
            address:        [email protected]
            sender_name:    Acme Demo Resetting
        template: MembersManagementBundle:Registration:resetting.html.twig

I verified indention rules and the template MembersManagementBundle:Registration:confirmation.html.twig physically exists. Additionnaly as you see, template of resetting doesn't create any problem. What could be the things I am missing? Your help is appreciated.

Upvotes: 0

Views: 1545

Answers (2)

Adib Aroui
Adib Aroui

Reputation: 5067

Sometimes, you spend a lot of time trying to figure out what is the cause of an issue, till you post it on SO and find after solution yourself.

There is no possible parameter with name email under registration, so solution is to do:

 registration:
        confirmation:
            template: MembersManagementBundle:Registration:confirmation.html.twig

Instead of:

registration:
        email: 
            template: MembersManagementBundle:Registration:confirmation.html.twig

Which is not similar to resetting and requires no analogy.

Upvotes: 1

Cruz
Cruz

Reputation: 725

The option email does not exist in the configuration reference for registration section. It only exists for resetting section.

Upvotes: 1

Related Questions