PHPackages                             cicerbro/sendy-php-api - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. cicerbro/sendy-php-api

AbandonedArchivedLibrary[API Development](/categories/api)

cicerbro/sendy-php-api
======================

Sendy PHP API Wrapper: Complete API interfacing.

6.0.3(2y ago)010MITPHP

Since Jan 19Pushed 1mo agoCompare

[ Source](https://github.com/CicerBro/Sendy-PHP-API)[ Packagist](https://packagist.org/packages/cicerbro/sendy-php-api)[ RSS](/packages/cicerbro-sendy-php-api/feed)WikiDiscussions master Synced yesterday

READMEChangelog (2)Dependencies (1)Versions (5)Used By (0)

[![](https://camo.githubusercontent.com/b45c67846433fb42b5ef79108372be66c504def67b6f8b0a5aad6ed84381421b/68747470733a2f2f692e696d6775722e636f6d2f46796c565a7a792e706e67)](https://camo.githubusercontent.com/b45c67846433fb42b5ef79108372be66c504def67b6f8b0a5aad6ed84381421b/68747470733a2f2f692e696d6775722e636f6d2f46796c565a7a792e706e67)🚀 Sendy PHP API Wrapper: Complete API interfacing.

[![emoji-log](https://camo.githubusercontent.com/74a435b8dd65c1edbc76aba6baa0124555dc47f52888b267e866519ccf35cdfa/68747470733a2f2f63646e2e7261776769742e636f6d2f61686d616461776169732f73747566662f636139373837342f656d6f6a692d6c6f672f666c61742d726f756e642e737667)](https://github.com/ahmadawais/Emoji-Log/)

📨 SENDY API
-----------

[](#-sendy-api)

Forked from the original author: [ahmadawais/Sendy-PHP-API](https://github.com/ahmadawais/Sendy-PHP-API)
--------------------------------------------------------------------------------------------------------

[](#forked-from-the-original-author-ahmadawaissendy-php-api)

Warning

This package is deprecated. Existing integrations should continue to work, but this repository is no longer actively maintained and will not receive future updates.

With this `Sendy PHP API Wrapper` you can do the following:

**SUBSCRIBERS****LISTS****CAMPAIGNS**SubscribeSet ListCreateUnsubscribeGet ListDraftDelete subscriberActive subscriber countSendSubscription statusList Segments handlingAssign to brandsGetting Started
---------------

[](#getting-started)

Getting started is easy. Here's how you do it. You can check the example.php file as well. Obviously, you'll have to download the wrapper to your current setup. Several ways to do that.

### **\#1** MANUAL INSTALL:

[](#1-manual-install)

Git clone this repo and include `./src/API.php` in your project.

### **\#2** COMPOSER INSTALL:

[](#2-composer-install)

Composer Install is the preferred method.

```
composer require ahmadawais/sendy-php-api
```

#### Step 0. Require the wrapper

[](#step-0-require-the-wrapper)

```
// New way using PSR4 Standard autoloader. Recommended
require_once . '/vendor/autoload.php';

// Old way of requiring all files manually. Not recommended.
require_once( 'API.php' );
```

#### Step 1. Configure it

[](#step-1-configure-it)

```
// 2. Configuration.
$config = [
	'sendyUrl' => 'https://send_installation_url.com', // Your Sendy installation URL (without trailing slash).
	'apiKey'   => 'XXXXXXXXXXXXXXXX', // Your API key. Available in Sendy Settings.
	'listId'   => 'XXXXXXXXXXXXXXXX',
];
```

#### Step 2. Init

[](#step-2-init)

```
use AhmadAwais\Sendy\API as Sendy;

$sendy = new Sendy( $config );
```

API KEY METHODS
---------------

[](#api-key-methods)

1. Method: `subscribe()`.
2. Method: `unsubscribe()`.
3. Method: `subStatus()`.
4. Method: `delete()`.
5. Method: `subCount()`.
6. Method: `campaign()`.

### Method #1: Subscribe

[](#method-1-subscribe)

```
// Method #1: Subscribe.
$responseArray = $sendy->subscribe(
	[
		'email'     => 'your@email.com', // This is the only field required by sendy.
		'name'      => 'Name', // User name (optional).
		'custom'    => 'Field Value', // You can custom fields as well (optional).
		'country'   => 'US', // User 2 letter country code (optional).
		'ipaddress' => 'XX.XX.XX.XXX', // User IP address (optional).
		'referrer'  => 'https://AhmadAwais.com/', // URL where the user signed up from (optional).
		'gdpr'      => true, // GDPR compliant? Set this to "true" (optional).
	]
);
```

### Method #2: Unsubscribe

[](#method-2-unsubscribe)

```
$responseArray = $sendy->unsubscribe( 'your@email.com' );
```

### Method #3: Subscriber Status

[](#method-3-subscriber-status)

```
$responseArray = $sendy->subStatus( 'your@email.com' );
```

### Method #4: Delete Subscriber

[](#method-4-delete-subscriber)

```
$responseArray = $sendy->delete( 'your@email.com' );
```

### Method #5: Subscriber Count of a list

[](#method-5-subscriber-count-of-a-list)

```
$responseArray = $sendy->subCount();
```

### Method #6: Campaign — Draft And/Or Send as well

[](#method-6-campaign--draft-andor-send-as-well)

```
// Method #6: Campaign — Draft And/Or Send as well.
$responseArray = $sendy->campaign(
	array(
		'from_name'            => 'Your Name',
		'from_email'           => 'your@email.com',
		'reply_to'             => 'your@email.com',
		'title'                => 'Title', // the title of your campaign.
		'subject'              => 'Your Subject',
		'plain_text'           => 'An Amazing campaign', // Optional.
		'html_text'            => 'Amazing campaign',
		'brand_id'             => 1, // Required only if you are creating a 'Draft' campaign. That is `send_campaign` set to 0.
		'send_campaign'        => 0, // SET: Draft = 0 and Send = 1 for the campaign.
		// Required only if you set send_campaign to 1 and no `segment_ids` are passed in.. List IDs should be single or comma-separated.
		'list_ids'             => 'XXXXXXXX, XXXXXXXX',
		// Required only if you set send_campaign to 1 and no `list_ids` are passed in. Segment IDs should be single or comma-separated.
		'segment_ids'          => '1',
		// Lists to exclude. List IDs should be single or comma-separated. (optional).
		'exclude_list_ids'     => '',
		// Segments to exclude. Segment IDs should be single or comma-separated. (optional).
		'exclude_segments_ids' => '',
		'query_string'         => 'XXXXXXXX', // Eg. Google Analytics tags.
	)
);
```

### Method #7: Set List ID

[](#method-7-set-list-id)

```
// Method #7: Change the `XXXXXXX` you are referring to at any point.
$sendy->setListId( 'XXXXXXX' );
```

### Method #8: Get List ID

[](#method-8-get-list-id)

```
// Method #7: Get the `XXXXXXX` you are referring to at any point.
$sendy->getListId();
```

Response
--------

[](#response)

The response of this PHP wrapper is custom-built. At the moment, it always returns a PHP Array. This array has the `status` of your action and an appropriate `message` in the response.

- `status` is either `true` or `false`.
- `message` is based on the type of action being performed

```
    // E.g. SUCCESS response.
    [
        'status'  => true,
        'message' => 'Already Subscribed'
    ];

    // E.g. FAIL response.
    [
        'status'  => false,
        'message' => 'Some fields are missing.'
    ];
```

[![📝](https://raw.githubusercontent.com/ahmadawais/stuff/master/images/git/log.png)](changelog.md)

Changelog
---------

[](#changelog)

[❯ Read the changelog here →](changelog.md)

**KEY**: `📦 NEW`, `👌 IMPROVE`, `🐛 FIX`, `📖 DOC`, `🚀 RELEASE`, and `✅ TEST`

> *I use [Emoji-log](https://github.com/ahmadawais/Emoji-Log), you should try it and simplify your git commits.*

[![📃](https://raw.githubusercontent.com/ahmadawais/stuff/master/images/git/license.png)](./../../)

License &amp; Conduct
---------------------

[](#license--conduct)

- MIT © [Ahmad Awais](https://twitter.com/MrAhmadAwais/)
- [Code of Conduct](code-of-conduct.md)
- Props to Jacob Bennett for his initial work on the lib.
- Requires at least PHP 5.3.0 (otherwise remove the namespaces).

[![🙌](https://raw.githubusercontent.com/ahmadawais/stuff/master/images/git/connect.png)](./../../)

Connect
-------

[](#connect)

[![GitHub @AhmadAwais](https://camo.githubusercontent.com/633a0170e4e2bb5fc23f5671ca11bd4cc7ecd73763ea721d0f523a8b31a6ce7e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4749544855422d677261792e7376673f636f6c6f72423d366363363434267374796c653d666c6174)](https://github.com/ahmadawais) **(follow)** To stay up to date on free &amp; open-source software

[![Twitter @MrAhmadAwais](https://camo.githubusercontent.com/9e6094a2e76940bfbf347be4dbcc49b3af86b77610f75352f1fd2531875f7ef1/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f545749545445522d677261792e7376673f636f6c6f72423d316461316632267374796c653d666c6174)](https://twitter.com/MrAhmadAwais/) **(follow)** To get #OneDevMinute daily hot tips &amp; trolls

[![YouTube AhmadAwais](https://camo.githubusercontent.com/8b497a509f64aa09389ebf7c40e01fd4b71175efe4501e07149c2a7fd4b4aaeb/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f594f55545542452d677261792e7376673f636f6c6f72423d666630303030267374796c653d666c6174)](https://www.youtube.com/AhmadAwais) **(subscribe)** To tech talks &amp; #OneDevMinute videos

[![Blog: AhmadAwais.com](https://camo.githubusercontent.com/565e32a40c8feb39ab05b4dd636a86d013cf4535acbe469663125e80d165c3da/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4d59253230424c4f472d677261792e7376673f636f6c6f72423d344432414646267374796c653d666c6174)](https://AhmadAwais.com/) **(read)** In-depth &amp; long form technical articles

[![LinkedIn @MrAhmadAwais](https://camo.githubusercontent.com/35fcbe77945225e3914f21acf58e4bcaae5ecb22d92275e33328e1d56ae8aa41/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c494e4b4544494e2d677261792e7376673f636f6c6f72423d303037376235267374796c653d666c6174)](https://www.linkedin.com/in/MrAhmadAwais/) **(connect)** On the LinkedIn profile y'all

[![👌](https://raw.githubusercontent.com/ahmadawais/stuff/master/images/git/sponsor.png)](./../../)

Sponsor
-------

[](#sponsor)

Me ([Ahmad Awais](https://twitter.com/mrahmadawais/)) and my incredible wife ([Maedah Batool](https://twitter.com/MaedahBatool/)) are two engineers who fell in love with open source and then with each other. You can read more [about me here](https://ahmadawais.com/about). If you or your company use any of my projects or like what I’m doing then consider backing me. I'm in this for the long run. An open-source developer advocate.

[![Ahmad on Twitter](https://camo.githubusercontent.com/532bf329bcfcc8ea6b5d5e30a0cd9e1e4bda146a74b834b517c97d50df9f4217/68747470733a2f2f696d672e736869656c64732e696f2f747769747465722f666f6c6c6f772f6d7261686d616461776169732e7376673f7374796c653d736f6369616c266c6162656c3d466f6c6c6f77253230404d7241686d61644177616973)](https://twitter.com/mrahmadawais/)

[![Ahmad on Twitter](https://raw.githubusercontent.com/ahmadawais/stuff/master/sponsor/sponsor.jpg)](https://github.com/AhmadAwais/sponsor)

###  Health Score

32

—

LowBetter than 69% of packages

Maintenance60

Regular maintenance activity

Popularity5

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity45

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 89.7% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~32 days

Total

3

Last Release

832d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/177757655?v=4)[CicerBro](/maintainers/CicerBro)[@CicerBro](https://github.com/CicerBro)

---

Top Contributors

[![ahmadawais](https://avatars.githubusercontent.com/u/960133?v=4)](https://github.com/ahmadawais "ahmadawais (61 commits)")[![CicerBro](https://avatars.githubusercontent.com/u/177757655?v=4)](https://github.com/CicerBro "CicerBro (4 commits)")[![Copilot](https://avatars.githubusercontent.com/in/1143301?v=4)](https://github.com/Copilot "Copilot (1 commits)")[![fireatwill](https://avatars.githubusercontent.com/u/22934180?v=4)](https://github.com/fireatwill "fireatwill (1 commits)")[![scottlaurent](https://avatars.githubusercontent.com/u/17208297?v=4)](https://github.com/scottlaurent "scottlaurent (1 commits)")

---

Tags

apiwrappernewsletterSendy

### Embed Badge

![Health badge](/badges/cicerbro-sendy-php-api/health.svg)

```
[![Health](https://phpackages.com/badges/cicerbro-sendy-php-api/health.svg)](https://phpackages.com/packages/cicerbro-sendy-php-api)
```

###  Alternatives

[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3741.3M47](/packages/tencentcloud-tencentcloud-sdk-php)[eslazarev/wildberries-sdk

Wildberries OpenAPI clients (generated).

273.0k](/packages/eslazarev-wildberries-sdk)[ahmadawais/sendy-php-api

Sendy PHP API Wrapper: Complete API interfacing.

8580.6k](/packages/ahmadawais-sendy-php-api)[resend/resend-php

Resend PHP library.

617.2M43](/packages/resend-resend-php)[files.com/files-php-sdk

Files.com PHP SDK

2481.1k](/packages/filescom-files-php-sdk)[checkout/checkout-sdk-php

Checkout.com SDK for PHP

563.6M13](/packages/checkout-checkout-sdk-php)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
