Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

NotificationsYou must be signed in to change notification settings

coderflexx/laravel-sendy

Repository files navigation

Latest Version on PackagistGitHub Tests Action StatusGitHub Code Style Action Status


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.

Installation

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'),];

API Keys

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

Sendy Version

This package is compatible withSendy v6.1.2 (Latest)

Usage

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()}

Async Argument for HTTP Requests

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();

Subscribers

In order to create a create/delete a subscriber, you have to access the subscribers service first, then to the action

Subscribe a User

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

Unsubscribe a User

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

Delete Subscriber

useCoderflex\LaravelSendy\Facades\Sendy;$data = ['email' =>'john@example.com','list_id' =>'123',];$response = Sendy::subscribers()->delete(                data:$data,                async:false            );

Full DocumentationHere

Subscriber Status

useCoderflex\LaravelSendy\Facades\Sendy;$data = ['email' =>'john@example.com','list_id' =>'123',];$response = Sendy::subscribers()->status(                data:$data,                async:false            );

Full DocumentationHere

Subscribers Count

useCoderflex\LaravelSendy\Facades\Sendy;$data = ['email' =>'john@example.com','list_id' =>'123',];$response = Sendy::subscribers()->count(                listId:'123',                async:false            );

Full DocumentationHere

Lists

Same thing as thesubscribers service, you can access thelists() service, then the http action you want.

Get Lists

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

Brands

Laravel Sendy allows you to retrieve all the brand list you have by

useCoderflex\LaravelSendy\Facades\Sendy;$response = Sendy::brands()->get();

Full DocumentationHere

Create & Send Compaigns

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

Testing

composertest

Changelog

Please seeCHANGELOG for more information on what has changed recently.

Contributing

Please seeCONTRIBUTING for details.

Security Vulnerabilities

Please reviewour security policy on how to report security vulnerabilities.

Credits

License

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

Stars

Watchers

Forks

Sponsor this project

    Contributors3

    •  
    •  
    •  

    Languages


    [8]ページ先頭

    ©2009-2025 Movatter.jp