PHPackages                             dansmaculotte/laravel-newsletter - 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. dansmaculotte/laravel-newsletter

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

dansmaculotte/laravel-newsletter
================================

Manage newsletters in Laravel

v4.0.0(4y ago)02.7k1MITPHPPHP ^8.1

Since Nov 21Pushed 4y agoCompare

[ Source](https://github.com/dansmaculotte/laravel-newsletter)[ Packagist](https://packagist.org/packages/dansmaculotte/laravel-newsletter)[ Docs](https://github.com/dansmaculotte/laravel-newsletter)[ RSS](/packages/dansmaculotte-laravel-newsletter/feed)WikiDiscussions master Synced 2d ago

READMEChangelogDependencies (6)Versions (12)Used By (0)

Manage newsletters in Laravel
=============================

[](#manage-newsletters-in-laravel)

[![Latest Version](https://camo.githubusercontent.com/015d63b5fd1848f663066ac37515e131c56811fb04cc1dac324e123e15e37ba7/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f64616e736d6163756c6f7474652f6c61726176656c2d6e6577736c65747465722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/dansmaculotte/laravel-newsletter)[![Total Downloads](https://camo.githubusercontent.com/8215938590c48f3faee360760b3b19e073c47578dcec3e7da4f7e6dbba76c5d8/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f64616e736d6163756c6f7474652f6c61726176656c2d6e6577736c65747465722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/dansmaculotte/laravel-newsletter)[![Build Status](https://camo.githubusercontent.com/64699816b67f7d43e6d6d0834453d4eef2603f43e9e04bb85e6f5a5ccaac2379/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f64616e736d6163756c6f7474652f6c61726176656c2d6e6577736c65747465722f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/dansmaculotte/laravel-newsletter)[![Quality Score](https://camo.githubusercontent.com/745bdc31a7e0eb64a3a8983905a4c0df12452376f9285e7dd6a177bc610cd5d3/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f64616e736d6163756c6f7474652f6c61726176656c2d6e6577736c65747465722e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/dansmaculotte/laravel-newsletter)[![Code Coverage](https://camo.githubusercontent.com/e80e28161618b22fb64dc698290c81520c6c8cfb4d9b299dd8fde8b1448777ea/68747470733a2f2f696d672e736869656c64732e696f2f636f766572616c6c732f6769746875622f64616e736d6163756c6f7474652f6c61726176656c2d6e6577736c74657465722e7376673f7374796c653d666c61742d737175617265)](https://coveralls.io/github/dansmaculotte/laravel-newsletter)

This package is a fork from spatie/laravel-newsletter. It provides an easy way to integrate different email services with Laravel.

There are 2 drivers available:

- [Mailchimp](https://developer.mailchimp.com/documentation/mailchimp/)
- [Mailjet](https://dev.mailjet.com/guides/#about-the-mailjet-api)

There is also and `log` and `null` driver for testing and debug purpose.

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

[](#installation)

You can install this package via composer using:

```
composer require dansmaculotte/laravel-newsletter
```

The package will automatically register itself.

To publish the config file to `config/newsletter.php` run:

```
php artisan vendor:publish --provider="DansMaCulotte\Newsletter\NewsletterServiceProvider"
```

This will publish a file `newsletter.php` in your config directory.

Finally, install the email service package needed:

- Mailchimp

```
composer require drewm/mailchimp-api
```

- Mailjet

```
composer require mailjet/mailjet-apiv3-php
```

Usage
-----

[](#usage)

Configure your mail template driver and credentials in `config/newsletter.php`.

After you've installed the package and filled in the values in the config-file working with this package will be a breeze. All the following examples use the facade. Don't forget to import it at the top of your file.

```
use Newsletter;
```

### Subscribing, updating and unsubscribing

[](#subscribing-updating-and-unsubscribing)

Subscribing an email address can be done like this:

```
use Newsletter;

Newsletter::subscribe('rincewind@discworld.com');
```

Add add email address to list but excluded from marketing emails

```
use Newsletter;

Newsletter::addMember('rincewind@discworld.com');
```

Let's unsubscribe someone:

```
Newsletter::unsubscribe('the.luggage@discworld.com');
```

You can pass options as the second argument:

```
Newsletter::subscribe('rincewind@discworld.com', ['FNAME' => 'Rince', 'LNAME' => 'Wind']);
```

You can subscribe someone to a specific list by using the third argument:

```
Newsletter::subscribe('rincewind@discworld.com', ['FNAME' => 'Rince', 'LNAME' => 'Wind'], 'subscribers');
```

That third argument is the name of a list you configured in the config file.

You can also subscribe and/or update someone. The person will be subscribed or updated if he/she is already subscribed:

```
Newsletter::subscribeOrUpdate('rincewind@discworld.com', ['FNAME' => 'Foo', 'lastname' => 'Bar']);
```

You can also unsubscribe someone from a specific list:

```
Newsletter::unsubscribe('rincewind@discworld.com', 'subscribers');
```

### Deleting subscribers

[](#deleting-subscribers)

Deleting is not the same as unsubscribing. Unlike unsubscribing, deleting a member will result in the loss of all history (add/opt-in/edits) as well as removing them from the list. In most cases you want to use `unsubscribe` instead of `delete`.

Here's how to perform a delete:

```
Newsletter::delete('rincewind@discworld.com');
```

### Getting subscriber info

[](#getting-subscriber-info)

You can get information on a subscriber by using the `getMember` function:

```
Newsletter::getMember('lord.vetinari@discworld.com');
```

This will return an array with information on the subscriber. If there's no one subscribed with that e-mail address the function will return `false`

There's also a convenience method to check if someone is already subscribed:

```
Newsletter::hasMember('nanny.ogg@discworld.com'); //returns a boolean
```

In addition to this you can also check if a user is subscribed to your list:

```
Newsletter::isSubscribed('lord.vetinari@discworld.com'); //returns a boolean
```

### Handling errors

[](#handling-errors)

If something went wrong you can get the last error with:

```
Newsletter::getLastError();
```

### Need something else?

[](#need-something-else)

If you need more functionality you get an instance of the underlying Api with:

```
$api = Newsletter::getApi();
```

### Mailjet notes

[](#mailjet-notes)

Connection timeouts may occur when using mailjet, as described [here](https://github.com/mailjet/mailjet-apiv3-php/issues/157). You can configure the value you want with configuration key `mailjet.connection_timeout`, itself using environment variable `MJ_CONNECTION_TIMEOUT`.

Testing
-------

[](#testing)

Run the tests with:

```
vendor/bin/phpunit
```

### Changelog

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

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

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

35

—

LowBetter than 79% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community21

Small or concentrated contributor base

Maturity73

Established project with proven stability

 Bus Factor1

Top contributor holds 67.3% 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 ~84 days

Recently: every ~176 days

Total

11

Last Release

1527d ago

Major Versions

1.2.1 → 2.0.02020-05-06

2.0.0 → v3.0.02020-11-30

v3.1.0 → v4.0.02022-03-09

PHP version history (3 changes)v1.0.0PHP ^7.2

v3.0.0PHP ^7.4

v4.0.0PHP ^8.1

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/498465?v=4)[Gaël Reyrol](/maintainers/GaelReyrol)[@gaelreyrol](https://github.com/gaelreyrol)

![](https://www.gravatar.com/avatar/777575bd441b3393f38a0865d5365a071c18e0989b5a4c9fc90426217876085a?d=identicon)[romain-dmc](/maintainers/romain-dmc)

---

Top Contributors

[![freekmurze](https://avatars.githubusercontent.com/u/483853?v=4)](https://github.com/freekmurze "freekmurze (138 commits)")[![gaelreyrol](https://avatars.githubusercontent.com/u/498465?v=4)](https://github.com/gaelreyrol "gaelreyrol (19 commits)")[![sebastiandedeyne](https://avatars.githubusercontent.com/u/1561079?v=4)](https://github.com/sebastiandedeyne "sebastiandedeyne (9 commits)")[![lartisan](https://avatars.githubusercontent.com/u/7920412?v=4)](https://github.com/lartisan "lartisan (5 commits)")[![drbyte](https://avatars.githubusercontent.com/u/404472?v=4)](https://github.com/drbyte "drbyte (3 commits)")[![Chroq](https://avatars.githubusercontent.com/u/9250470?v=4)](https://github.com/Chroq "Chroq (3 commits)")[![jasonmccreary](https://avatars.githubusercontent.com/u/161071?v=4)](https://github.com/jasonmccreary "jasonmccreary (3 commits)")[![rubenvanassche](https://avatars.githubusercontent.com/u/619804?v=4)](https://github.com/rubenvanassche "rubenvanassche (3 commits)")[![akoepcke](https://avatars.githubusercontent.com/u/5311185?v=4)](https://github.com/akoepcke "akoepcke (2 commits)")[![arondeparon](https://avatars.githubusercontent.com/u/7697?v=4)](https://github.com/arondeparon "arondeparon (2 commits)")[![d-jimenez](https://avatars.githubusercontent.com/u/74740646?v=4)](https://github.com/d-jimenez "d-jimenez (2 commits)")[![rtouze](https://avatars.githubusercontent.com/u/917039?v=4)](https://github.com/rtouze "rtouze (2 commits)")[![robindirksen1](https://avatars.githubusercontent.com/u/22446895?v=4)](https://github.com/robindirksen1 "robindirksen1 (1 commits)")[![tomcoonen](https://avatars.githubusercontent.com/u/988013?v=4)](https://github.com/tomcoonen "tomcoonen (1 commits)")[![Yugis](https://avatars.githubusercontent.com/u/14917669?v=4)](https://github.com/Yugis "Yugis (1 commits)")[![amosmos](https://avatars.githubusercontent.com/u/2318695?v=4)](https://github.com/amosmos "amosmos (1 commits)")[![carlos-ea](https://avatars.githubusercontent.com/u/5512089?v=4)](https://github.com/carlos-ea "carlos-ea (1 commits)")[![carusogabriel](https://avatars.githubusercontent.com/u/16328050?v=4)](https://github.com/carusogabriel "carusogabriel (1 commits)")[![filisko](https://avatars.githubusercontent.com/u/8798694?v=4)](https://github.com/filisko "filisko (1 commits)")[![floflock](https://avatars.githubusercontent.com/u/3831745?v=4)](https://github.com/floflock "floflock (1 commits)")

---

Tags

facadelaravelmailchimpmailjetnewsletterlaravelmailchimpnewsletter

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/dansmaculotte-laravel-newsletter/health.svg)

```
[![Health](https://phpackages.com/badges/dansmaculotte-laravel-newsletter/health.svg)](https://phpackages.com/packages/dansmaculotte-laravel-newsletter)
```

###  Alternatives

[spatie/laravel-newsletter

Manage Mailcoach and MailChimp newsletters in Laravel

1.6k6.3M26](/packages/spatie-laravel-newsletter)[s-ichikawa/laravel-sendgrid-driver

This library adds a 'sendgrid' mail driver to Laravel.

4139.3M1](/packages/s-ichikawa-laravel-sendgrid-driver)[laravel-notification-channels/discord

Laravel notification driver for Discord.

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

A robust and unified SMS gateway integration package for Laravel, supporting multiple providers.

320244.3k6](/packages/tzsk-sms)[therobfonz/laravel-mandrill-driver

Mandrill Driver for Laravel

773.5M](/packages/therobfonz-laravel-mandrill-driver)[erag/laravel-disposable-email

A Laravel package to detect and block disposable email addresses.

226102.4k](/packages/erag-laravel-disposable-email)

PHPackages © 2026

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