alfredo-ramos/mailrelay-api-client

0.1.1 2022-06-15 20:44 UTC

This package is auto-updated.

Last update: 2024-10-30 08:52:08 UTC


README

About

A Mailrelay API client.

Build Status Latest Stable Version Code Quality License

⚠️ 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.