Hi together,
in my cli.php i set the mail for my di like this:
$di->set('mail', function () {
return new Mail();
});
In my task, I'ld like to send an email like this:
$this->getDI()->get('mail')->sendMail(
$this->di->get('config')->mail,
[
$customerEmail => $customerEmail
],
$this->di->get('translations')->_('foobar'),
'mailTemplate',
[
'foo' => 'bar'
]
);
When executing the task, I receive this exception:
Catchable fatal error: Argument 1 passed to Swift_Mime_SimpleMessage::__construct() must be an instance of Swift_Mime_HeaderSet, none given
Any help?
Thank you so much
Christian