mailgun / mailgun-php

Mailgun's Official SDK for PHP
http://www.mailgun.com
MIT License
1.09k stars 314 forks source link

Improvement: SDK version headers v2 vs v3 #869

Closed Pilskalns closed 11 months ago

Pilskalns commented 1 year ago

Hi,

I got really confused at first that the User-Agent version is v2. Then found out it is hardcoded to mailgun-sdk-php/v2 ... while the major version now is v3 (3.6.)

https://github.com/mailgun/mailgun-php/blob/02d8b5c7e082a64fb8e9bf9aea557501bf69fa41/src/HttpClient/HttpClientConfigurator.php#L73

Composer has this nice helper that could be used to retrieve the installed version on the fly without a need to patch code every major update:

\Composer\InstalledVersions::getVersion('mailgun/mailgun-php')

P.S. Might consider using some fallback value, in case someone runs code by direct download and includes it without Composer.

oleksandr-mykhailenko commented 11 months ago

Thank you, we made those changes