mailjet / mailjet-apiv3-php

[API v3] Mailjet PHP Wrapper
http://dev.mailjet.com
MIT License
267 stars 86 forks source link

Version overrided when not duplicated in $options #254

Closed MariusJam closed 2 years ago

MariusJam commented 2 years ago

Hello,

When you do :

$mj = new \Mailjet\Client(getenv('MJ_APIKEY_PUBLIC'), getenv('MJ_APIKEY_PRIVATE'),true,['version' => 'v3.1']);

/* set body */

$mj->post(Resources::$Email, ['body' => $body], ['timeout' => 5]);

The POST request is sent to https://api.mailjet.com/v3/send and not https://api.mailjet.com/v3.1/send as expected. The $options array provided in post() method erases the version set previously.

I have this issue with at least v1.5.5 and v1.5.6 of the Mailjet PHP client.

oleksandr-mykhailenko commented 2 years ago

Hello @MariusJam Issue was related and published in new version - https://github.com/mailjet/mailjet-apiv3-php/releases/tag/v1.5.7

MariusJam commented 2 years ago

Hello @oleksandr-mykhailenko,

Thanks for the quick fix ! The version 1.5.7 resolves the issue indeed.