sebkay / arbalest
An all-in-one, easy to use solution for sending emails with various APIs.
2.6.3
2021-12-02 23:34 UTC
Requires
- php: ^7.3 | ^8.0
- campaignmonitor/createsend-php: ^6.1
- guzzlehttp/guzzle: ^7.3
Requires (Dev)
- fakerphp/faker: ^1.16
- nunomaduro/phpinsights: ^2.0
- pestphp/pest: ^1.21
- spatie/ray: ^1.30
- squizlabs/php_codesniffer: ^3.5
README
A simple all-in-one solution for managing email list subscribers in PHP.
Supported
- Mailchimp (Example)
- Campaign Monitor (Example)
- ConvertKit (Example)
- ActiveCampaign (Example)
- Omnisend (Example)
Installation
This package is available on Packagist and can be installed via Composer like so:
composer require sebkay/arbalest
Usage
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('test@test.com'); $arbalest->unsubscribe('test@test.com'); // Multiple $arbalest->subscribeAll([ 'test_1@test.com', 'test_2@test.com', 'test_3@test.com', ]); $arbalest->unsubscribeAll([ 'test_1@test.com', 'test_2@test.com', 'test_3@test.com', ]);
Example (Mailchimp)
use Arbalest\Arbalest; use Arbalest\Services\Mailchimp; try { $arbalest = new Arbalest( new Mailchimp([ 'api_key' => '12345', 'server' => 'us2', 'list_id' => 'abcde', ]) ); $arbalest->subscribe('test@test.com'); } catch (\Exception $e) { // Do something on error }
Methods
These are the public methods available on Arbalest\Arbalest
.
Coming Soon
- Hubspot
- GetResponse
- Drip
- Constant Contact
- MailerLite
- Sendinblue
- AWeber
- GetResponse