laravel-mailjet
laravel-mailjet copied to clipboard
Missing dependencies?
It's kind of related to this one https://github.com/mailjet/laravel-mailjet/issues/53 .
The issue I am seeing is that after the upgrade to 3.0.1, it breaks saying the following: You cannot use "Symfony\Component\Mailer\Transport\AbstractHttpTransport" as the HttpClient component is not installed. Try running "composer require symfony/http-client"
Doing some research, looks like this package is not actually required as dependency, only if you use some specific mailer, maybe that's the case, I don't know. I can see this has been added on the require here: "symfony/mailjet-mailer": "^6.0" but maybe it is not enough.
If I install the symfony/http-client package though, I get then a different error:
"Swift_Mailer::__construct(): Argument #1 ($transport) must be of type Swift_Transport, Symfony\Component\Mailer\Bridge\Mailjet\Transport\MailjetApiTransport given, called in /var/www/vendor/laravel/framework/src/Illuminate/Mail/MailManager.php on line 152"
do you think this is something you can help with?? (or am I completely lost :sweat_smile: ?)
Hi, I'm getting the same error (as per your second one). Did you solve it?
Nope, so far I'm just forcing the exact version 3.0.0 .... in my composer,json:
"mailjet/laravel-mailjet": "3.0.0",
I have the same issue
Can you please share your laravel version?
Sure! right now it's : "laravel/framework": "^8.81", (8.83.11)
It does work for me now, but I had to upgrade both the laravel framework to laravel 9 and this package at the same time.
It does work for me now, but I had to upgrade both the laravel framework to laravel 9 and this package at the same time.
@Loots-it Would you mind sharing the exacts versions you have installed to get it to work please? Thanks in advance
installing laravel 9 did fix this issue. I think you would need to install a previous mailjet version to get it running on a laravel version <=8. Alternatively you can use the API /send for transactional emails rather than using the mailjet driver.
an example I successfully used with laravel 8 is:
use Mailjet\LaravelMailjet\Facades\Mailjet;
use Mailjet\Resources;
$body = [ 'FromEmail' => "[email protected]", 'FromName' => "Your Mailjet Pilot", 'Recipients' => [ [ 'Email' => "[email protected]", 'Name' => "to name" ], [ 'Email' => "[email protected]", 'Name' => "another persons name" ] ], 'Subject' => "Your email flight plan!", 'Text-part' => "Dear passenger, welcome to Mailjet! May the delivery force be with you!", 'Html-part' => "<h3>Dear passenger, welcome to Mailjet!</h3><br />May the delivery force be with you!" ]; $sendTransactionalEmail = Mailjet::post(Resources::$Email,['body' => $body]);
I encountered the same issue on Laravel 9. adding "symfony/http-client": "^6.1" to my composer.json did the trick
Please, use laravel version 8+
@oleksandr-mykhailenko I'm using Laravel 9 and got this issue too.
symfony/http-client is a dev dependency of the laravel/framework package (since 9.*).