heterodoks/laravel-sendy is a Laravel package for laravel package for sendy api integration.
It currently has 0 GitHub stars and 10 downloads on Packagist (latest version v1.0.2).
Install it with composer require heterodoks/laravel-sendy.
Discover more Laravel packages by heterodoks
or browse all Laravel packages to compare alternatives.
Last updated
A Laravel package for integrating with the Sendy API.
You can install the package via composer:
composer require heterodoks/laravel-sendy
The package will automatically register its service provider.
Publish the configuration file:
php artisan vendor:publish --tag="sendy-config"
Add these variables to your .env file:
SENDY_URL=your-sendy-installation-url
SENDY_API_KEY=your-api-key
SENDY_BRAND_ID=your-brand-id
SENDY_TIMEOUT=10
use Heterodoks\LaravelSendy\Facades\Sendy;
// Basic subscription
$result = Sendy::subscribe('list_id', '[email protected]');
// With additional details
$result = Sendy::subscribe(
'list_id',
'[email protected]',
'John Doe',
['custom_field' => 'value'],
true // GDPR consent
);
$result = Sendy::unsubscribe('list_id', '[email protected]');
$status = Sendy::getSubscriptionStatus('list_id', '[email protected]');
// Returns: "Subscribed", "Unsubscribed", "Unconfirmed", "Bounced", "Soft bounced", or "Complained"
$count = Sendy::getActiveSubscriberCount('list_id');
$result = Sendy::createCampaign(
'John Doe', // From Name
'[email protected]', // From Email
'[email protected]', // Reply To
'Campaign Title', // Title
'Email Subject', // Subject
'Plain text version', // Plain Text
'<p>HTML version</p>', // HTML Text
'list-id', // List ID or array of List IDs
'brand-id', // Optional: Brand ID
'utm_source=newsletter' // Optional: Query String
); ```
#### Create Draft Campaign
```php
$result = Sendy::createDraftCampaign(
'John Doe',
'[email protected]',
'[email protected]',
'Campaign Title',
'Email Subject',
'Plain text version',
'<p>HTML version</p>',
['list-id-1', 'list-id-2'], // Multiple lists
'brand-id',
'utm_source=newsletter'
); ```
#### Schedule Campaign
```php
$result = Sendy::scheduleCampaign(
'John Doe',
'[email protected]',
'[email protected]',
'Campaign Title',
'Email Subject',
'Plain text version',
'<p>HTML version</p>',
'list-id',
'2024-12-31 23:59:59', // Schedule datetime
'brand-id',
'utm_source=newsletter'
); ```
### Subscriber Management
#### Delete Subscriber
```php
$result = Sendy::deleteSubscriber('list_id', '[email protected]');
// Available statuses: active, unconfirmed, unsubscribed, bounced, complained
$count = Sendy::getSubscriberCountByStatus('list_id', 'active');
// Get total active subscribers for default brand
$total = Sendy::getTotalActiveSubscribers();
// Get total active subscribers for specific brand
$total = Sendy::getTotalActiveSubscribers('brand-id');
// Basic update
$result = Sendy::updateSubscriber('list_id', '[email protected]', 'New Name');
// Update with custom fields
$result = Sendy::updateSubscriber(
'list_id',
'[email protected]',
'New Name',
['custom_field' => 'new_value']
);
composer test
The MIT License (MIT). Please see License File for more information.