I am trying to override the default transport for Swiftmailer by using my own service. This would allow me to use the same method calls as you would with Swiftmailer such as setTo, setSubject,attach, etc. However, I am getting the following error message:
The service definition "swiftmailer.mailer.transport.test.mailer" does not exist.
I am currently using Symfony 2.5 with Swiftmailer Bundle ~2.3. Please see my src/Bundle/ApplicationBundle/Resources/config/services.xml file and my app/config/config.yml file parts associated with this issue:
services.xml
<parameters>
<parameter key="test.mailer.class">TEST\Bundle\TestBundle\Mail\MailQueueTransport</parameter>
</parameters>
<services>
<service id="test.mailer" class="%test.mailer.class%">
<argument type="service" id="service_container"/>
</service>
</services>
config.yml
imports:
- { resource: "@TESTTestBundle/Resources/config/services.xml"}
swiftmailer:
transport: "test.mailer"
All other services work just fine and this method worked in Symfony 2.1.3 with Swiftmailer Bundle 2.1.0. The goal is the use the built in Swiftmailer functionality but to place the emails into a database queue for processing rather than send direct emails (batch processing for high email volumes).
Any assistance would be appreciated.