PHPackages                             jacobbennett/sendyphp - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. jacobbennett/sendyphp

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

jacobbennett/sendyphp
=====================

A PHP Library for interfacing with the Sendy newsletter system (http://sendy.co)

v2.0(5y ago)134162.6k↓44.9%38[2 PRs](https://github.com/JacobBennett/SendyPHP/pulls)1MITPHPPHP &gt;=5.3.0

Since Feb 15Pushed 5y ago18 watchersCompare

[ Source](https://github.com/JacobBennett/SendyPHP)[ Packagist](https://packagist.org/packages/jacobbennett/sendyphp)[ RSS](/packages/jacobbennett-sendyphp/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (6)Dependencies (2)Versions (7)Used By (1)

SendyPHP
========

[](#sendyphp)

[![Latest Version on Packagist](https://camo.githubusercontent.com/8fc66fe7ea3c0df86e2ebe9407747c21100c0cf38341f00905a5a91480f46ee2/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6a61636f6262656e6e6574742f73656e64797068702e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/jacobbennett/sendyphp)[![Total Downloads](https://camo.githubusercontent.com/e2bae4ae7fbf601f81420ebf4da2d7adc5ef05f50125afb774d20c16ff2daabe/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6a61636f6262656e6e6574742f73656e64797068702e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/jacobbennett/sendyphp)

A PHP class built to interface with the Sendy API ()

Installation
------------

[](#installation)

### Using Composer

[](#using-composer)

Begin by installing this package through Composer. Edit your project's `composer.json` file to require `jacobbennett/sendyphp`.

```
"require": {
	"jacobbennett/sendyphp": "1.3.*"
}

```

Next, update Composer from the Terminal:

```
composer update

```

### Non-Composer Installation

[](#non-composer-installation)

- Grab the `src/SendyPHP.php`file and place it into your file structure.
- Require SendyPHP in the location you would like to utilize it.

```
	require('SendyPHP.php');
```

Usage
=====

[](#usage)

Create an instance of the class while passing in an array including your API key, installation URL, and the List ID you wish to work with.

```
	$config = array(
		'api_key' => 'yourapiKEYHERE', //your API key is available in Settings
		'installation_url' => 'http://updates.mydomain.com',  //Your Sendy installation
		'list_id' => 'your_list_id_goes_here'
	);

	$sendy = new \SendyPHP\SendyPHP($config);

	//you can change the list_id you are referring to at any point
	$sendy->setListId("a_different_list_id");
```

Methods
=======

[](#methods)

After creating a new instance of SendyPHP call any of the methods below

Return Values
-------------

[](#return-values)

The return value of any of these functions will include both a status, and a message to go with that status.

The status is a boolean value of `true` or `false` and the message will vary based on the type of action being performed.

```
	//example of a succesful return value
	array(
		'status'=>true,
		'message'=>'Already Subscribed'
	)

	//example of a UNsuccesful return value
	array(
		'status'=>false,
		'message'=>'Some fields are missing.'
	)
```

I have commented and organized the code so as to be readable, if you have further questions on the status or messages being returned, please refer to the library comments.

subscribe(array $values)
------------------------

[](#subscribearray-values)

This method takes an array of `$values` and will attempt to add the `$values` into the list specified in `$list_id`

```
	$results = $sendy->subscribe(array(
		'name'=>'Jim',
		'email' => 'Jim@gmail.com', //this is the only field required by sendy
		'customfield1' => 'customValue'
	));
```

**Note:** Be sure to add any custom fields to the list in Sendy before utilizing them inside this library. **Another Note:** If a user is already subscribed to the list, the library will return a status of `true`. Feel free to edit the code to meet your needs.

unsubscribe($email)
-------------------

[](#unsubscribeemail)

Unsubscribes the provided e-mail address (if it exists) from the current list.

```
	$results = $sendy->unsubscribe('test@testing.com');
```

substatus($email)
-----------------

[](#substatusemail)

Returns the status of the user with the provided e-mail address (if it exists) in the current list.

```
	$results = $sendy->substatus('test@testing.com');
```

**Note:** refer to the code or see  for the types of return messages you can expect.

subcount()
----------

[](#subcount)

Returns the number of subscribers to the current list.

```
	$results = $sendy->subcount();
```

createCampaign(array $values)
-----------------------------

[](#createcampaignarray-values)

This method takes an array of `$values` and will creates a campaign (with an option to send it too).

```
	$results = $sendy->createCampaign(array(
		'from_name' => 'Some Name',
		'from_email' => 'some@domain.com',
		'reply_to' => 'some@domain.com',
		'subject' => 'Some Subject',
		'plain_text' => 'Amazing campaign', // (optional).
		'html_text' => 'Amazing campaign',
		'list_ids' => 'your_list_id', // Required only if you set send_campaign to 1.
		'brand_id' => 0, // Required only if you are creating a 'Draft' campaign.
		'query_string' => 'some', // eg. Google Analytics tags.
		'send_campaign' => 0 // Set to 1 if you want to send the campaign as well and not just create a draft. Default is 0.
	));
```

setListId($list\_id) and getListId()
------------------------------------

[](#setlistidlist_id-and-getlistid)

Change or get the list you are currently working with.

```

	//set or switch the list id
	$sendy->setListId('another_list_id');

	//get the current list id
	echo $sendy->getListId();
```

Unit tests
==========

[](#unit-tests)

All unit tests are located under src/test directory. To run the tests type in the below from the project root.

```
		php vendor/bin/phpunit src/test/SendyPHPTest.php
```

Ensure that the API keys are setup for testing :

```
		$config = [
			'api_key' => 'xxx', //your API key is available in Settings
			'installation_url' => 'http://my.sendy.installation.com',  //Your Sendy installation
			'list_id' => 'xxx'// List ID
		];
```

###  Health Score

42

—

FairBetter than 90% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity48

Moderate usage in the ecosystem

Community29

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 65.8% 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 ~506 days

Recently: every ~627 days

Total

6

Last Release

1942d ago

Major Versions

v1.3 → v2.02021-01-22

### Community

Maintainers

![](https://www.gravatar.com/avatar/50837c1464ddeb5a0d132c151fe7cde07e050e67206d50470d92f1e72cc7179e?d=identicon)[JacobBennett](/maintainers/JacobBennett)

---

Top Contributors

[![JacobBennett](https://avatars.githubusercontent.com/u/1517011?v=4)](https://github.com/JacobBennett "JacobBennett (52 commits)")[![jhk115](https://avatars.githubusercontent.com/u/1069438?v=4)](https://github.com/jhk115 "jhk115 (6 commits)")[![gayanhewa](https://avatars.githubusercontent.com/u/1681406?v=4)](https://github.com/gayanhewa "gayanhewa (5 commits)")[![tylercollier](https://avatars.githubusercontent.com/u/366538?v=4)](https://github.com/tylercollier "tylercollier (4 commits)")[![acairns](https://avatars.githubusercontent.com/u/705212?v=4)](https://github.com/acairns "acairns (4 commits)")[![dominic-p](https://avatars.githubusercontent.com/u/1195080?v=4)](https://github.com/dominic-p "dominic-p (1 commits)")[![BitPopCoin](https://avatars.githubusercontent.com/u/7988928?v=4)](https://github.com/BitPopCoin "BitPopCoin (1 commits)")[![birko](https://avatars.githubusercontent.com/u/1064302?v=4)](https://github.com/birko "birko (1 commits)")[![barchard](https://avatars.githubusercontent.com/u/17622?v=4)](https://github.com/barchard "barchard (1 commits)")[![jkabat](https://avatars.githubusercontent.com/u/6071927?v=4)](https://github.com/jkabat "jkabat (1 commits)")[![mindstormmaster](https://avatars.githubusercontent.com/u/2058134?v=4)](https://github.com/mindstormmaster "mindstormmaster (1 commits)")[![oliverkaiser](https://avatars.githubusercontent.com/u/2995870?v=4)](https://github.com/oliverkaiser "oliverkaiser (1 commits)")[![bryant1410](https://avatars.githubusercontent.com/u/3905501?v=4)](https://github.com/bryant1410 "bryant1410 (1 commits)")

---

Tags

newsletterSendy

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/jacobbennett-sendyphp/health.svg)

```
[![Health](https://phpackages.com/badges/jacobbennett-sendyphp/health.svg)](https://phpackages.com/packages/jacobbennett-sendyphp)
```

###  Alternatives

[hocza/sendy

Sendy API implementation for Laravel

71195.5k](/packages/hocza-sendy)[ahmadawais/sendy-php-api

Sendy PHP API Wrapper: Complete API interfacing.

8673.5k](/packages/ahmadawais-sendy-php-api)

PHPackages © 2026

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