mailgun/mailgun-php
Official Mailgun PHP SDK (PSR-18/PSR-7 compatible) for sending email and managing Mailgun API features like domains, IPs/pools, analytics, and subaccounts. Works with your chosen HTTP client; supports US/EU endpoints.
opened, clicked, unsubscribed and stored to the TotalResponseItem (#739 by @Arkitecht)Mailgun::webhooks() no longer requires an explicit $signingKey argument.
When omitted, it falls back to the API key stored on the Mailgun instance,
restoring compatibility with pre-v4.3.7 usage patterns (issue #947).Mailgun\Api\Ip:
listIpPools() — GET /v3/ip_poolscreateIpPool(name, description) — POST /v3/ip_poolsupdateIpPool(poolId, data) — PATCH /v3/ip_pools/{pool_id} (add/remove IPs, rename, link/unlink domains)getIpPoolDomains(poolId, limit, page) — GET /v3/ip_pools/{pool_id}/domainsaddIpToPool(poolId, ip) — PUT /v3/ip_pools/{pool_id}/ips/{ip}removeIpFromPool(poolId, ip) — DELETE /v3/ip_pools/{pool_id}/ips/{ip}addIpsToPool(poolId, ips[]) — POST /v3/ip_pools/{pool_id}/ips.jsondelegateIpPool(poolId, subaccountId) — PUT /v3/ip_pools/{pool_id}/delegaterevokeDelegatedIpPool(poolId, subaccountId) — DELETE /v3/ip_pools/{pool_id}/delegateassignIpToAllDomains(ip) — POST /v3/ips/{ip}/domainsremoveIpFromAllDomains(ip, alternative) — DELETE /v3/ips/{ip}/domainslistIpsDetailed(params) — GET /v3/ips/details/allMailgun\Model\Ip\IpPoolsResponse — pool list with pool_id, name, description, ips[], is_inherited, is_linkedMailgun\Model\Ip\IpPoolResponse — single pool details (replaces incorrect UpdateResponse usage)Mailgun\Model\Ip\IpPoolDomainsResponse — paginated domain list with nextPage cursorMailgun\Model\Ip\IpReferenceResponse — async-operation responses carrying message + reference_idMailgun\Model\Ip\IpDetailsResponse — detailed IP list for /v3/ips/details/allIp API methods, including request URI/body assertions and response model property checksloadDIPPInformation() was hydrating into UpdateResponse (message-only); now correctly returns IpPoolResponsedeleteDIPP() replacement parameters ($ip, $repPoolId) were wrongly required; both are now optional (?string = null)deleteDIPP() URL was built via unsafe string concatenation; replaced with proper http_build_query constructionaddNewDIPPIntoAccount() used unsafe direct array key access ($data['description']); replaced with null-coalescing guardplaceAccountIpToBand() had a redundant Assert::stringNotEmpty() call alongside Assert::ip() on the same valueaddNewDIPPIntoAccount() marked [@deprecated](https://github.com/deprecated) in favour of the explicit createIpPool(string $name, string $description) methodAccountManagement API endpoints:
updateAccountSettings for PUT /v5/accountsgetHttpSigningKey for GET /v5/accounts/http_signing_keycreateHttpSigningKey for POST /v5/accounts/http_signing_keygetSandboxAuthRecipients for GET /v5/sandbox/auth_recipientsAccountManagement API responses:
AccountResponseHttpSigningKeyResponseSandboxAuthRecipientsResponseMailgun class to include AccountManagement API.to and reply-to have the same addresscreateMultiplehttp or https - set your open, click and unsubscribe URLs to use http or https. The default is http^1.0 and ^2.0 for php-http/guzzle6-adapter (#680 by @boboldehampsink)reply_preference parameter (#684 by @twoonesixdigital)Force DKIM Authority when creating a Domain (#686 by @Tiboonn)log-level property for Events (#704 by @uavn)null (#639 by @indapublic)ShowResponse::getContentIdMap() (#664 by @lvdhoorn)Ip::index() now returns all IPs instead of the shared IPs (#707 by @josephshanak)Mailgun\Model are final or abstract.RequestBuilder and HttpClientConfigurator to Mailgun\HttpClient namespaceMailgun::__construct()php-http/message.complaints to Stats / Total Response$mailgun = Mailgun::create('key', 'server');Mailgun\Api\AttachmentMessageBuilder and BatchMessageMailgun\Message\MessageBuilder::addBccRecipient() is now optional.Suppressions::getTotalCount() methodREADME.md fileTags on UnsubscribeMailgun\Exception\HttpServerExceptionHttpClientException::getResponseCode()AbstractDomainResponse that VerifyResponse and CreateResponse extends.WebhookIndexResponse.TotalResponse that caused the content to be empty.Domain::create to be optional.php-http/multipart-stream-builderMessageBuilder we surround the recipient name with double quotes instead of single quotes.MultipartStreamBuilder after a stream is built.$mailgun->messages()->sendMime()This version contains a new way of using the API. Each endpoint return a domain object and the endpoints are grouped like the API documentation.
Mailgun\Exception.Mailgun\Exception namespace.HttpClientConfigurator to configure the HTTP client.History and ReplaceUriPluginMailgun\Mailgun::getLastResponse()Mailgun\Connection\RestClient::getAttachment($url)The following classes will be removed in version 3.0.
Mailgun\Connection\Exceptions\GenericHTTPErrorMailgun\Connection\Exceptions\InvalidCredentialsMailgun\Connection\Exceptions\MissingEndpointMailgun\Connection\Exceptions\MissingRequiredParametersMailgun\Connection\Exceptions\NoDomainsConfiguredMailgun\Connection\RestClientMailgun\Constants\ApiMailgun\Constants\ExceptionMessagesMailgun\Mailgun::$resetClientMailgun\Mailgun::sendMessage()Mailgun\Mailgun::verifyWebhookSignature()Mailgun\Mailgun::post()Mailgun\Mailgun::get()Mailgun\Mailgun::delete()Mailgun\Mailgun::put()Mailgun\Mailgun::setApiVersion()Mailgun\Mailgun::setSslEnabled()Mailgun\Mailgun::MessageBuilder()Mailgun\Mailgun::OptInHandler()Mailgun\Mailgun::BatchMessage()Bugfixes:
Enhancement:
Bugfixes:
Enhancement:
Bugfixes:
Bugfixes:
Bugfixes:
Initial Release!
How can I help you explore Laravel packages today?