A simple all-in-one solution for managing email list subscribers in PHP.
- Mailchimp (Example)
- Campaign Monitor (Example)
- ConvertKit (Example)
- ActiveCampaign (Example)
- Omnisend (Example)
This package is available on Packagist and can be installed via Composer like so:
composer require sebkay/arbalest
First, create the Arbalest\Arbalest
instance. This is the object you'll use to manage subscribers.
Second, provide the Arbalest instance a service. For example Mailchimp (Arbalest\Services\Mailchimp
).
Then you can either subscribe or unsubscribe email addresses like so:
// Single
$arbalest->subscribe('[email protected]');
$arbalest->unsubscribe('[email protected]');
// Multiple
$arbalest->subscribeAll([
'[email protected]',
'[email protected]',
'[email protected]',
]);
$arbalest->unsubscribeAll([
'[email protected]',
'[email protected]',
'[email protected]',
]);
use Arbalest\Arbalest;
use Arbalest\Services\Mailchimp;
try {
$arbalest = new Arbalest(
new Mailchimp([
'api_key' => '12345',
'server' => 'us2',
'list_id' => 'abcde',
])
);
$arbalest->subscribe('[email protected]');
} catch (\Exception $e) {
// Do something on error
}
These are the public methods available on Arbalest\Arbalest
.
Method | @return |
---|---|
subscribe(string $email_address)
|
bool
|
unsubscribe(string $email_address)
|
bool
|
subscribeAll(array $email_addresses)
|
bool
|
unsubscribeAll(array $email_addresses)
|
bool
|
- Hubspot
- GetResponse
- Drip
- Constant Contact
- MailerLite
- Sendinblue
- AWeber
- GetResponse