0

I am trying to use sonataNotificationBundle, I did all configurations as mentioned in documentation, but I am getting following error,

Unrecognized options swift_mailer under sonata_notification.consumers

Before that I was getting

Unrecognized options consumer under sonata_notification

I dig in to sonata/NotificationBundle/DependencyInjection/Configuration.php, there

->arrayNode('consumers')

is written in code but in documentation it is "consumer"

http://sonata-project.org/bundles/notification/2-1/doc/reference/advanced_configuration.html

I changed to it "consumers" after that I am now getting below error

Unrecognized options swift_mailer under sonata_notification.consumers
vishal
  • 3,993
  • 14
  • 59
  • 102

1 Answers1

0

This is a typo in the doc (swift_mailer is a 2.0 configuration, the doc is not up to date at all), you can fork and edit it.

Just delete the consumers option in the configuration file.

rpg600
  • 2,800
  • 18
  • 24
  • after adding below lines of code, I could make it work ->arrayNode('consumers') ->addDefaultsIfNotSet() ->children() ->arrayNode('swift_mailer') ->addDefaultsIfNotSet() ->children() ->scalarNode('path')->end() ->end() ->end() ->end() ->end() – vishal Jul 12 '13 at 12:55
  • don't do that, you need to delete the consumers option in your config.yml, it will add the default value automatically. – rpg600 Jul 12 '13 at 12:59
  • worked ! thanks but emails are getting stored to database but not getting sent to email address. How to trigger swiftmailer consumer? I have created another question for this, http://stackoverflow.com/questions/17615547/sonatanotificationbundle-emails-getting-stored-to-database-but-swiftmailer-cons – vishal Jul 12 '13 at 13:04
  • also please modify your answer to mention to remove consumers from configuration so that I can accept it. But still ideally if the option is given it should work properly. – vishal Jul 12 '13 at 13:06