Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork0
Laravel Sendy is a simple and clean wrapper for the Sendy API, making it easy to manage subscribers, lists, and campaigns directly from your Laravel application.
License
coderflexx/laravel-sendy
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Laravel Sendy is a simple and clean wrapper for the Sendy API, making it easy to manage subscribers, lists, and campaigns directly from your Laravel application.
You can install the package via composer:
composer require coderflexx/laravel-sendy
You can publish the config file with:
php artisan vendor:publish --tag="laravel-sendy"
This is the contents of the published config file:
return [/* |-------------------------------------------------------------------------- | Sendy Installation URL |-------------------------------------------------------------------------- | | This URL is used to connect to your Sendy installation. It should | point to the root of your Sendy installation. For example: | https://your-sendy-installation.com */'sendy_installation_url' =>env('SENDY_INSTALLATION_URL','https://your-sendy-installation.com'),/* |-------------------------------------------------------------------------- | Sendy API Key |-------------------------------------------------------------------------- | | This key is used to authenticate your application with the Sendy | installation. You can find your API key in the Sendy settings. | Make sure to keep this key secure and do not share it with anyone. | It is recommended to use environment variables to store sensitive | information like API keys. You can set the SENDY_API_KEY */'sendy_api_key' =>env('SENDY_API_KEY','your-sendy-api-key'),];
After Installation, you can grab yourAPI KEYS
from the sendy app installation, then add them in.env
file
SENDY_INSTALLATION_URL=https://your-app-installation.com/SENDY_API_KEY=your-api-key
This package is compatible withSendy v6.1.2 (Latest)
In order to use the package, you can use the facade directly, followed by the main method api (e.g.subscribers()
then the verb (action))
useCoderflex\LaravelSendy\Facades\Sendy;$sendy = Sendy::{$service()}->{$action()}
All HTTP requests support anasync
option, allowing you todefer execution. This is useful when a request doesn't need to run immediately or isn't a high priority. You can handle it later using await when you're ready to process the result.
Example:
$promise = Sendy::subscribers()->subscribe( data:$data, async:true// The request is deferred and returns a promise);// perform other tasks/operation here// later, wait for the response when you're ready.$response =$promise->await();
In order to create a create/delete a subscriber, you have to access the subscribers service first, then to the action
useCoderflex\LaravelSendy\Facades\Sendy;$data = ['name' =>'John Doe','email' =>'john@example.com','list' =>'123','country' =>'US',];$response = Sendy::subscribers()->subscribe( data:$data, async:false );
Full DocumentationHere
useCoderflex\LaravelSendy\Facades\Sendy;$data = ['email' =>'john@example.com','list' =>'123','boolean' =>true,// to get plan text response, instead of json.];$response = Sendy::subscribers()->unsubscribe( data:$data, async:false );
Full DocumentationHere
useCoderflex\LaravelSendy\Facades\Sendy;$data = ['email' =>'john@example.com','list_id' =>'123',];$response = Sendy::subscribers()->delete( data:$data, async:false );
Full DocumentationHere
useCoderflex\LaravelSendy\Facades\Sendy;$data = ['email' =>'john@example.com','list_id' =>'123',];$response = Sendy::subscribers()->status( data:$data, async:false );
Full DocumentationHere
useCoderflex\LaravelSendy\Facades\Sendy;$data = ['email' =>'john@example.com','list_id' =>'123',];$response = Sendy::subscribers()->count( listId:'123', async:false );
Full DocumentationHere
Same thing as thesubscribers service, you can access thelists()
service, then the http action you want.
useCoderflex\LaravelSendy\Facades\Sendy;$data = ['brand_id' =>'123','include_hidden' =>'yes',// either yes or no.];$response = Sendy::lists()->get( data:$data, async:false );
Full DocumentationHere
Laravel Sendy allows you to retrieve all the brand list you have by
useCoderflex\LaravelSendy\Facades\Sendy;$response = Sendy::brands()->get();
Full DocumentationHere
useCoderflex\LaravelSendy\Facades\Sendy;$data = ['subject' =>'Test Subject','from_name' =>'John Doe','from_email' =>'john@example.com','reply_to' =>'alex@example.com','title' =>'Test Title','plain_text' =>'This is a plain text version of the email.','html_text' =>'<h1>This is a HTML version of the email.</h1>','list_ids' =>'abc123','segment_ids' =>'xyz456','exclude_list_ids' =>null,'exclude_segment_ids' =>null,'brand_id' =>'123','query_string' =>null,'track_opens' =>1,'track_clicks' =>1,'send_campaign' =>1,// if set to 1 the compaign will be created & sent.'schedule_date_time' =>null,'schedule_timezone' =>null,];$response = Sendy::compaigns()->create( data:$data, async:false );
If you want to create and send the compaign at the same time, usecreateAndSend
method
$response = Sendy::compaigns()->createAndSend( data:$data, async:false );
Full DocumentationHere
composertest
Please seeCHANGELOG for more information on what has changed recently.
Please seeCONTRIBUTING for details.
Please reviewour security policy on how to report security vulnerabilities.
The MIT License (MIT). Please seeLicense File for more information.
About
Laravel Sendy is a simple and clean wrapper for the Sendy API, making it easy to manage subscribers, lists, and campaigns directly from your Laravel application.
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Sponsor this project
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Contributors3
Uh oh!
There was an error while loading.Please reload this page.