[Flow] Unresolved dependency in TYPO3\SwiftMailer\Mailer

Christian Loock chl at vkf-renzel.de
Fri Feb 20 15:45:19 CET 2015


Have your tried requesting the Interface instead?

$this->objectManager->get('TYPO3\\SwiftMailer\\MailerInterface');


This is just a wild guess, but since the configuration is made for the 
interface, it would make sense. Also, you might consider using property 
injection instead with @Inject . This definitly works with Interfaces, 
not sure about direct calls on the OM.

h2h

Am 20.02.2015 um 15:43 schrieb toco at aimeos.org:
> Hi all
>
> I've added the TYPO3.SwiftMailer package via composer and want to send an e-mail but I get a TYPO3\Flow\Object\Exception\UnresolvedDependenciesException instead when executing
>
> $this->objectManager->get('\\TYPO3\\SwiftMailer\\Mailer');
>
> The detailed description of the error is:
>    Missing required constructor argument $transport in class
>    TYPO3\SwiftMailer\Mailer. Note that constructor injection is only support
>    for objects of scope singleton (and this is not a singleton) – for
>    other scopes you must pass each required argument to the constructor
>    yourself.
>
> The Objects.yaml file of the TYPO3.SwiftMailer package seems to contain the necessary configuration for resolving the dependency:
>
> TYPO3\SwiftMailer\TransportInterface:
>    scope: prototype
>    factoryObjectName: TYPO3\SwiftMailer\TransportFactory
>    arguments:
>      1:
>        setting: TYPO3.SwiftMailer.transport.type
>      2:
>        setting: TYPO3.SwiftMailer.transport.options
>      3:
>        setting: TYPO3.SwiftMailer.transport.arguments
>
> TYPO3\SwiftMailer\MailerInterface:
>    arguments:
>      1:
>        object: TYPO3\SwiftMailer\TransportInterface
>
> What am I doing wrong or how it is supposed to work?
>
> Thanks
>
>
> Toco
>
> _______________________________________________
> Flow mailing list
> Flow at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/flow



More information about the Flow mailing list