PHPackages                             lorenzofaresin/mailup-rest-client - 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. lorenzofaresin/mailup-rest-client

ActiveLibrary[API Development](/categories/api)

lorenzofaresin/mailup-rest-client
=================================

Unofficial MailUp Rest Client

077PHP

Since Jul 11Pushed 4y agoCompare

[ Source](https://github.com/lorenzofaresin/mailup-rest-client)[ Packagist](https://packagist.org/packages/lorenzofaresin/mailup-rest-client)[ RSS](/packages/lorenzofaresin-mailup-rest-client/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependenciesVersions (2)Used By (0)

MailUp Rest Client
==================

[](#mailup-rest-client)

[![Build Status](https://camo.githubusercontent.com/0f14c2eecda498df3ed48fabab578b1807ee5eba472e0fbd13deb3e3764d37f8/68747470733a2f2f7472617669732d63692e6f72672f66617a6c616e642f6d61696c75702d726573742d636c69656e742e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/fazland/mailup-rest-client) [![Scrutinizer Code Quality](https://camo.githubusercontent.com/c53ac6458e4b9708d65498e91cac93827e089d6117e804e19dd3097cd183cdd1/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f66617a6c616e642f6d61696c75702d726573742d636c69656e742f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/fazland/mailup-rest-client/?branch=master) [![Code Coverage](https://camo.githubusercontent.com/6d98e363346263acd8a8aab5789345dcc1f273b892d3efdfec5cd15fb31db0fe/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f66617a6c616e642f6d61696c75702d726573742d636c69656e742f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/fazland/mailup-rest-client/?branch=master)

Fazland's MailUp Rest Client is an unofficial PHP Rest Client for the Email and SMS GatewayProvider [MailUp](http://www.mailup.com).

Requirements
------------

[](#requirements)

- php &gt;= 7.0
- php-http/client-implementation &gt;= 1.0
- php-http/discovery &gt;= 1.0
- php-http/message &gt;= 1.0
- php-http/message-factory &gt;= 1.0
- psr/http-message &gt;= 1.0
- psr/http-message-implementation &gt;= 1.0
- symfony/options-resolver &gt;= 2.7

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

[](#installation)

The suggested installation method is via [composer](https://getcomposer.org/):

```
$ composer require fazland/mailup-rest-client
```

Using MailUp Rest Client
------------------------

[](#using-mailup-rest-client)

It's really simple. First of all, configuration!

### Configuration

[](#configuration)

The mandatory configuration parameters are:

- `username`
- `password`
- `client_id`
- `client_secret`

The only optional parameter is `cache_dir`. If set, the access token are saved in that path.

Just create a `Context` object passing to the constructor the parameters as an array:

```
use Fazland\MailUpRestClient\Context;

$config = [
    'username' => 'your_username',
    'password' => 'your_password',
    'client_id' => 'your_client_id',
    'client_secret' => 'your_client_secret',
    'cache_dir' => 'path_to_your_cache_dir', // Optional
];

$httpClient = new HttpClientImplementation();

$context = new Context($config, $httpClient);
```

### Mailing Lists

[](#mailing-lists)

To create a `MailingList` you can follow this example. Please, refer to the [MailUp official API docs](http://help.mailup.com/display/mailupapi/Manage+Lists+and+Groups#ManageListsandGroups-CreateList) for the `$params` array.

```
use Fazland\MailUpRestClient\MailingList;

$email = "owner_of_the_list@email.com";
$listName = "list_name";
$params = [
    // your params...
];

$list = MailingList::create($context, $listName, $email, $params);
```

You can also obtain all the existing lists in your MailUp account by calling the static method `MailingList::getAll()`:

```
use Fazland\MailUpRestClient\MailingList;

$lists = MailingList::getAll($context);
```

Once you have an instance of `MailingList`, you can do the following operations:

- add a `Recipient`

```
use Fazland\MailUpRestClient\Recipient;

$list->addRecipient(new Recipient('Aragorn', 'aragorn@gondor.com', '3333333333', '+39'));
```

- update a `Recipient`

```
use Fazland\MailUpRestClient\Recipient;

$list->updateRecipient(new Recipient('Aragorn', 'aragorn@gondor.com', '3334444444', '+39'));
```

- remove a `Recipient`

```
use Fazland\MailUpRestClient\Recipient;

$list->removeRecipient(new Recipient('Aragorn', 'aragorn@gondor.com', '3333333333', '+39'));
```

- find a `Recipient` by its `email`

```
$recipient = $list->findRecipient('aragorn@gondor.com'); // null returned if current email was not found
```

- retrieve all the groups of the current list:

```
$groups = $list->getGroups();
```

- count how many recipients are in the list (default is subscribed, but you can search for unsubscribed o pending statuses too):

```
$countRecipients = $list->countRecipients(); // equal to $list->countRecipients(Recipient::STATUS_SUBSCRIBED);
// OR
$countRecipients = $list->countRecipients(Recipient::STATUS_UNSUBSCRIBED);
// OR
$countRecipients = $list->countRecipients(Recipient::STATUS_PENDING);
```

- get recipients paginated (you can specify the same status used in MailingList::countRecipients()):

```
$recipients = $list->getRecipientsPaginated($pageNumber, $pageSize);
```

- least, but not last, import an array of `Recipient` objects:

```
$list->import($recipients);
```

### Groups

[](#groups)

Each `MailingList` can be split into multiple groups. The operations available are the following:

- retrieve or modify its name:

```
$group->getName();
$group->setName('Gondor Army');
```

- retrieve or modify its notes:

```
$group->getNotes();
$group->setNotes('10.000 knights and 20.000 peons');
```

- prevent or allow deletion:

```
$group->isDeletable();
$group->setDeletable(true);
```

- delete:

```
$group->delete();
```

- add, remove or retrieve the recipients:

```
use Fazland\MailUpRestClient\Recipient;

$legolas = new Recipient('Legolas Thranduilion', 'legolas@lothlorien.elf', '3334444444', '+39');
$group->addRecipient($legolas);
$group->removeRecipient($legolas);
$lothlorienCitizens = $group->getRecipients();
```

Contributing
------------

[](#contributing)

Contributions are welcome. Feel free to open a PR or file an issue here on GitHub!

License
-------

[](#license)

MailUp Rest Client is licensed under the MIT License - see the [LICENSE](https://github.com/fazland/mailup-rest-client/blob/master/LICENSE) file for details

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity42

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 60% 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/5b208499e101eea142f219c1c60fdfd0f1a5b6ac99a3a430be5c5fdd36cd4219?d=identicon)[lfaresin](/maintainers/lfaresin)

---

Top Contributors

[![massimilianobraglia](https://avatars.githubusercontent.com/u/17158942?v=4)](https://github.com/massimilianobraglia "massimilianobraglia (6 commits)")[![lorenzofaresin](https://avatars.githubusercontent.com/u/4178083?v=4)](https://github.com/lorenzofaresin "lorenzofaresin (2 commits)")[![jzfgo](https://avatars.githubusercontent.com/u/79468?v=4)](https://github.com/jzfgo "jzfgo (1 commits)")[![lfaresin-dmind](https://avatars.githubusercontent.com/u/40820063?v=4)](https://github.com/lfaresin-dmind "lfaresin-dmind (1 commits)")

### Embed Badge

![Health badge](/badges/lorenzofaresin-mailup-rest-client/health.svg)

```
[![Health](https://phpackages.com/badges/lorenzofaresin-mailup-rest-client/health.svg)](https://phpackages.com/packages/lorenzofaresin-mailup-rest-client)
```

###  Alternatives

[stripe/stripe-php

Stripe PHP Library

4.0k143.3M480](/packages/stripe-stripe-php)[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M272](/packages/twilio-sdk)[knplabs/github-api

GitHub API v3 client

2.2k15.8M187](/packages/knplabs-github-api)[facebook/php-business-sdk

PHP SDK for Facebook Business

90121.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

73813.7M114](/packages/meilisearch-meilisearch-php)[google/gax

Google API Core for PHP

263103.1M454](/packages/google-gax)

PHPackages © 2026

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