alfredo-ramos / mailrelay-api-client
Mailrelay API Client
Fund package maintenance!
www.paypal.me/IngAlfredoRamos/10.00USD
alfredoramos.mx/donate
Installs: 3 677
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Requires
- php: ^7.2.5 || ^8.0.0
- guzzlehttp/guzzle: ^7.2.0
Requires (Dev)
- phpunit/phpunit: ^8.5.14 || ^9.5.2
This package is auto-updated.
Last update: 2024-11-30 09:06:34 UTC
README
About
A Mailrelay API client.
⚠️ While all API endpoints have been implemented, it's still under development, so it might have some bugs.
Requirements
- PHP 7.2.5 or greater
Installation
Open your composer.json
file and add the package in the require
object:
"alfredo-ramos/mailrelay-api-client": "^0.1.0"
Then run composer update
on your terminal.
Usage
The constructor takes an array
with the API data needed to connect with your Mailrelay account.
require __DIR__ . '/vendor/autoload.php'; $mailrelay = new AlfredoRamos\Mailrelay\Client([ 'api_account' => 'mailrelay_account', 'api_token' => 'mailrelay_api_token' ]);
You can access each endpoint using the AlfredoRamos\Mailrelay\Client::api()
method.
// Create or update a subscriber $mailrelay->api('subscribers')->sync([ 'status' => 'active', 'email' => 'user@example.org', 'group_ids' => [1] ]); // Get account package info $mailrelay->api('package')->info();
For more detailed information about Mailrelay API endpoints, please refer to the official API documentation.