PHPackages                             rubenbuijs/mailcoach-api-wrapper - 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. [Mail &amp; Notifications](/categories/mail)
4. /
5. rubenbuijs/mailcoach-api-wrapper

ActiveLibrary[Mail &amp; Notifications](/categories/mail)

rubenbuijs/mailcoach-api-wrapper
================================

API wrapper to connect with a standalone Mailcoach server.

491↑80.7%PHP

Since Oct 30Pushed 4y ago1 watchersCompare

[ Source](https://github.com/rubenbuijs/mailcoach-api-wrapper)[ Packagist](https://packagist.org/packages/rubenbuijs/mailcoach-api-wrapper)[ RSS](/packages/rubenbuijs-mailcoach-api-wrapper/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Mailcoach API Wrapper
=====================

[](#mailcoach-api-wrapper)

This is an API wrapper for Spatie's [Mailcoach](https://mailcoach.app/). Use this package when you have installed Mailcoach on a standalone server - separate from your app. I favored the standalone instance because it reduced dependencies in my apps.

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

[](#installation)

A prerequisite is that you have installed Mailcoach as a standalone app.

You can install this package via composer:

```
composer require rubenbuijs/mailcoach-api-wrapper
```

### Configuration

[](#configuration)

```
MAILCOACH_API_BASE_URL=https://yourdomain.com/api
MAILCOACH_API_TOKEN=1|XXXXXXXXXXXXXXXXXXXXXXX # Mailcoach installation: Config->API Tokens
MAILCOACH_LIST_ID=1
MAILCOACH_SSL=false
```

Usage
-----

[](#usage)

After installation, the Newsletter class is available to interact with your Mailcoach server.

### Subscribe a new person

[](#subscribe-a-new-person)

```
Newsletter::subscribe(string $email, string $name, array $tags = [])
```

### Update a subscriber

[](#update-a-subscriber)

Enter NULL when you don't want to make changes to the email, name, or tags.

```
Newsletter::update(string $email, string $new_email = null, string $name = null, array $tags = null)
```

### Add tag(s)

[](#add-tags)

```
Newsletter::addTags(string $email, array $tags_to_add)
```

### Delete tag(s)

[](#delete-tags)

```
Newsletter::deleteTags(string $email, array $tags_to_delete)
```

### Retrieve subscriber data

[](#retrieve-subscriber-data)

```
Newsletter::getSubscriberByEmail(string $email)
```

Enjoyed this package?
---------------------

[](#enjoyed-this-package)

Take a look at my products:

- [Boei](https://www.boei.help?ref=github_mailcoach-api-wrapper): Website Lead, Communication &amp; Social widget
- [ProductLift](https://www.productlift.dev?ref=github_mailcoach-api-wrapper): World’s most flexible prioritization, roadmap, and changelog tool.

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity27

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% 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/4f38b461ab341430950604528ceac351618c1a5063da2f339de22de272e9776a?d=identicon)[rubenbuijs](/maintainers/rubenbuijs)

---

Top Contributors

[![rubenbuijs](https://avatars.githubusercontent.com/u/9210390?v=4)](https://github.com/rubenbuijs "rubenbuijs (2 commits)")

### Embed Badge

![Health badge](/badges/rubenbuijs-mailcoach-api-wrapper/health.svg)

```
[![Health](https://phpackages.com/badges/rubenbuijs-mailcoach-api-wrapper/health.svg)](https://phpackages.com/packages/rubenbuijs-mailcoach-api-wrapper)
```

###  Alternatives

[tijsverkoyen/css-to-inline-styles

CssToInlineStyles is a class that enables you to convert HTML-pages/files into HTML-pages/files with inline styles. This is very useful when you're sending emails.

5.8k505.3M228](/packages/tijsverkoyen-css-to-inline-styles)[minishlink/web-push

Web Push library for PHP

1.9k12.0M52](/packages/minishlink-web-push)[laravel-notification-channels/twilio

Provides Twilio notification channel for Laravel

2587.7M12](/packages/laravel-notification-channels-twilio)[spatie/url-signer

Generate a url with an expiration date and signature to prevent unauthorized access

4422.3M16](/packages/spatie-url-signer)[mattketmo/email-checker

Throwaway email detection library

2742.0M5](/packages/mattketmo-email-checker)[laravel-notification-channels/discord

Laravel notification driver for Discord.

2371.3M11](/packages/laravel-notification-channels-discord)

PHPackages © 2026

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