PHPackages                             martincamen/laravel-getanewsletter - 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. martincamen/laravel-getanewsletter

ActiveLibrary

martincamen/laravel-getanewsletter
==================================

Laravel wrapper for Get A Newsletter's API

08PHP

Since Mar 3Pushed 5y ago1 watchersCompare

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

READMEChangelogDependenciesVersions (1)Used By (0)

Laravel wrapper for Get A Newsletter's API
==========================================

[](#laravel-wrapper-for-get-a-newsletters-api)

This package uses Get A Newsletter's API version 3.0. Read the official docs at  for information about the API and possible params/arguments.

- [Installation](#installation)
- [Methods](#methods)
    - [Contacts](#contacts)
    - [E-mails](#emails)
    - [Lists](#lists)
    - [Attributes](#attributes)
    - [Subscriptions](#subscriptions)
    - [Reports](#reports)
        - [Opened](#opened)
        - [Non-opened](#non-opened)
        - [Bounces](#bounces)
        - [Links](#links)
        - [Clicks](#clicks)
        - [Unsubscriptions](#unsubscriptions)
    - [To do](#todo)

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

[](#installation)

Right now, since this isn't added to Packagist yet, this can be installed by adding the following to your `composer.json`:

```
"repositories": [
    {
        "type": "vcs",
        "url": "https://github.com/MartinCamen/laravel-getanewsletter"
    }
],
```

And adding this to the require section:

```
"martincamen/laravel-getanewsletter": "dev-master"
```

Publish the config file by running:

```
php artisan vendor:publish --provider="MartinCamen\GetANewsletter\GetANewsletterServiceProvider" --tag="config"
```

Get an authentication token from Get A Newsletter and set it in the config file or in the `.env` file and you're ready to go!

Methods
------------------------------------------

[](#methods)

*Almost all* of the following modules' `get()` methods are handled the same.

The `get()` method takes two arguments:

TypeDescriptionDefaultArrayOptional params (see [the docs](https://api.getanewsletter.com/v3/docs) for all possibilities)`[]`BooleanGet the results as a collection, `false` will return the raw response (including the count, the results, etc.)`true`Get all results for a specific module:

```
GetANewsletter::contacts()->get();

GetANewsletter::lists()->get();

// ...and so on.
```

With params:

```
GetANewsletter::contacts()->get(['page' => 1], false);

GetANewsletter::lists()->get(['page' => 1], false);

// ...and so on.
```

**The exceptions** are (for example) the submethods of `Reports` which takes `$reportId` as its first argument and sometimes another related `id` field as its second argument. The arguments mentioned above are then pushed to the second or third position and then following the same standard.

### Contacts

[](#contacts)

Get all contacts:

```
GetANewsletter::contacts()->get();
```

Create a new contact:

TypeDescriptionDefaultStringThe e-mail to store-ArrayOptional params (see [the docs](https://api.getanewsletter.com/v3/docs) for all possibilities)`[]`BooleanGet the results as a collection, `false` will return the raw response (including the count, the results, etc.)`true````
GetANewsletter::contacts()->create($email, $additionalData, false);
```

Update a contact:

TypeDescriptionDefaultStringThe e-mail to handle-ArrayOptional params to update (see [the docs](https://api.getanewsletter.com/v3/docs) for all possibilities). Non-mentioned params will not be updated.`[]`BooleanGet the results as a collection, `false` will return the raw response (including the count, the results, etc.)`true````
GetANewsletter::contacts()->update($email, $additionalData, false);
```

Delete a contact (pass the e-mail `(string)` to delete):

```
GetANewsletter::contacts()->delete($email);
```

### E-mails

[](#e-mails)

Get all e-mails (sent and drafts):

```
GetANewsletter::emails()->get();
```

### Drafts &amp; Sent e-mails

[](#drafts--sent-e-mails)

Get all drafts/sent:

```
GetANewsletter::drafts()->get();

GetANewsletter::sent()->get();
```

To get a specific e-mail, use the `find()` method with the appropriate ID (will return as a collection, pass `false` as a second argument if you want the raw response):

```
GetANewsletter::drafts()->find($id);

GetANewsletter::sent()->find($id, false);
```

Delete a draft/sent (pass the item's id `(int)` to delete):

```
GetANewsletter::drafts()->delete($id);
GetANewsletter::sent()->delete($id);
```

Create a new draft:

TypeDescriptionDefaultArrayParams. Required params are `subject` &amp; `body`.-BooleanGet the result as a collection, `false` will return the raw response (including the count, the results, etc.)`true````
GetANewsletter::drafts()->create($data, false);
```

Update a draft:

TypeDescriptionDefaultStringThe draft's id.-ArrayParams to update. Non-mentioned params will not be updated.`[]`BooleanGet the results as a collection, `false` will return the raw response (including the count, the results, etc.)`true````
GetANewsletter::drafts()->update($id, $additionalData, false);
```

Copy a draft (pass the draft's id `(int)` to copy, the second param is whether the result should be a collection or not):

```
GetANewsletter::drafts()->copy($id, false);
```

### Lists

[](#lists)

Get all lists:

```
GetANewsletter::lists()->get();
```

Create a new list:

TypeDescriptionDefaultArrayParams. Required params are `email`, `name` &amp; `sender`.-BooleanGet the results as a collection, `false` will return the raw response (including the count, the results, etc.)`true````
GetANewsletter::lists()->create($data, false);
```

Update a list:

TypeDescriptionDefaultStringThe list's hash.-ArrayParams to update. Non-mentioned params will not be updated.`[]`BooleanGet the results as a collection, `false` will return the raw response (including the count, the results, etc.)`true````
GetANewsletter::lists()->update($hash, $additionalData, false);
```

Delete a list (pass the list's hash `(string)` to delete):

```
GetANewsletter::lists()->delete($hash);
```

### Attributes

[](#attributes)

Get all attributes:

```
GetANewsletter::attributes()->get();
```

Create a new attribute:

TypeDescriptionDefaultStringName, required.-ArrayParams. Required params are `name` &amp; `sender`.-BooleanGet the results as a collection, `false` will return the raw response (including the count, the results, etc.)`true````
GetANewsletter::attributes()->create($name, $data, false);
```

Update an attribute:

TypeDescriptionDefaultStringThe name to change to. This is the only value that can be changed.-StringCode of the attribute to update.-BooleanGet the results as a collection, `false` will return the raw response (including the count, the results, etc.)`true````
GetANewsletter::attributes()->update($name, $code, false);
```

Delete an attribute (pass the attribute's code `(string)` to delete):

```
GetANewsletter::attributes()->delete($code);
```

### Subscriptions

[](#subscriptions)

Get all subscriptions:

```
GetANewsletter::subscriptions()->get();
```

### Reports

[](#reports)

Get all reports:

```
GetANewsletter::reports()->get();
```

To get a specific report, use the `find()` method with the appropriate ID (will return as a collection, pass `false` as a second param if you want the raw response):

```
GetANewsletter::reports()->find($id);

GetANewsletter::reports()->find($id, false);
```

#### Opened

[](#opened)

Get all opened for a specific report:

```
GetANewsletter::opened()->get($reportId);
```

Get information regarding a specific open for a specific report (pass `false` as a third param if you want the raw response):

```
GetANewsletter::opened()->find($reportId, $openId);
```

Get an aggregated report regarding a specific report:

```
GetANewsletter::opened()->aggregated($reportId);
```

#### Non-opened

[](#non-opened)

Get all non-opened for a specific report:

```
GetANewsletter::nonOpened()->get($reportId);
```

Get information regarding a specific non-open for a specific report (pass `false` as a third param if you want the raw response):

```
GetANewsletter::nonOpened()->find($reportId, $nonOpenedId);
```

#### Bounces

[](#bounces)

Get all bounces for a specific report:

```
GetANewsletter::bounces()->get($reportId);
```

Get information regarding a specific bounce for a specific report (pass `false` as a third param if you want the raw response):

```
GetANewsletter::bounces()->find($reportId, $bounceId);
```

#### Links

[](#links)

Get information regarding all links and data regarding clicks for a specific report:

```
GetANewsletter::links()->get($reportId);
```

Get information regarding a specific link for a specific report (pass `false` as a third param if you want the raw response):

```
GetANewsletter::links()->find($reportId, $linkId);
```

#### Clicks

[](#clicks)

Get information regarding clicks for a specific report and link:

```
GetANewsletter::links()->get($reportId, $linkId);
```

Get information regarding a specific click for a specific report and link (pass `false` as a fourth param if you want the raw response):

```
GetANewsletter::links()->find($reportId, $linkId, $clickId);
```

#### Unsubscriptions

[](#unsubscriptions)

Get information regarding all unsubscriptions for a specific report:

```
GetANewsletter::unsubscriptions()->get($reportId);
```

Get information regarding a specific unsubscription for a specific report (pass `false` as a second param if you want the raw response):

```
GetANewsletter::unsubscriptions()->find($reportId);
```

---

### To do

[](#to-do)

- Add all endpoints (including exports)
- Error handling
- ...and more.

###  Health Score

16

—

LowBetter than 5% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity30

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://avatars.githubusercontent.com/u/8720813?v=4)[Martin Camen](/maintainers/MartinCamen)[@MartinCamen](https://github.com/MartinCamen)

---

Top Contributors

[![MartinCamen](https://avatars.githubusercontent.com/u/8720813?v=4)](https://github.com/MartinCamen "MartinCamen (3 commits)")

### Embed Badge

![Health badge](/badges/martincamen-laravel-getanewsletter/health.svg)

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

PHPackages © 2026

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