Download the PHP package duta/duta-php without Composer
On this page you can find all versions of the php package duta/duta-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download duta/duta-php
More information about duta/duta-php
Files in duta/duta-php
Package duta-php
Short Description The official PHP SDK for Duta, transactional email for Malaysia, with a Laravel mail driver.
License MIT
Homepage https://docs.duta.indra.sh/sdks/
Informations about the package duta-php
duta/duta-php
The official PHP SDK for Duta, transactional email for Malaysia, with a Laravel mail driver.
- PHP 8.1+. One dependency, Guzzle. Laravel 12 and 13.
- Laravel: set
MAIL_MAILER=dutaand every Mailable sends through Duta. - Retries rate limits and server errors safely: every send carries an idempotency key, so a retry can never send twice.
Upgrading from 0.1.x
0.2.0 is a new SDK for Duta's current API, not an update of 0.1.x, which was written for an earlier version of Duta that no longer runs.
Install
Laravel
The package registers itself. Add your key to .env and choose the mailer:
Your existing mail code now sends through Duta:
Optional: put the key in config/services.php instead of the environment:
A Mailable can set two Duta-specific headers:
For everything else, inject Duta\Duta:
Send an email
Errors throw Duta\DutaException. getErrorCode() is Duta's
error code and getRequestId()
finds the request on the Logs screen.
Batch and paging
Verify webhooks
It throws Duta\WebhookVerificationException when the signature is wrong or
the delivery is more than five minutes old.
Everything else
emails |
send, get, list, listAll |
batch |
send |
domains |
create, list, get, verify, remove |
apiKeys |
create, list, remove |
webhooks |
create, list, get, remove, enable, test, deliveries, verify |
suppressions |
create, list, listAll, remove |
logs |
list, listAll, get |
usage |
get |
Options: new Duta\Duta($key, ['base_url' => ..., 'timeout' => 30.0, 'max_retries' => 2]).
Full documentation: https://docs.duta.indra.sh