I’m working on a Lumen application and trying to integrate Mailgun for email functionality. After installing the mailgun-php package using composer, I’m running into a constructor error.
Installation command used:
composer require mailgun/mailgun-php kriswallsmith/buzz nyholm/psr7
My current implementation:
use Mailgun\Mailgun;
$mailgunClient = new Mailgun('api-key-12345678901234567');
Error message I’m getting:
Argument 1 passed to Mailgun\Mailgun::__construct() must be an instance of Mailgun\HttpClient\HttpClientConfigurator, string given
It seems like the constructor signature has changed and it no longer accepts a string API key directly. Has anyone encountered this issue before? What’s the correct way to initialize the Mailgun client now?