PHPackages                             plutolinks/loops - 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. plutolinks/loops

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

plutolinks/loops
================

v0.3.0(9mo ago)422.2k↓21.9%5[4 issues](https://github.com/hosmelq/loops-php/issues)[2 PRs](https://github.com/hosmelq/loops-php/pulls)1MITPHPPHP ^8.1CI passing

Since Mar 11Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/hosmelq/loops-php)[ Packagist](https://packagist.org/packages/plutolinks/loops)[ RSS](/packages/plutolinks-loops/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (3)Dependencies (11)Versions (5)Used By (1)

Loops PHP
=========

[](#loops-php)

Introduction
------------

[](#introduction)

The Loops PHP SDK provides an expressive interface for interacting with [Loops](https://loops.so)'s API.

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

[](#requirements)

Requires PHP 8.1+

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

[](#installation)

You may install Loops into your project using the Composer package manager:

```
composer require plutolinks/loops
```

Usage
-----

[](#usage)

You can create an instance of the SDK like so:

```
use PlutoLinks\Loops\Loops;

$loops = Loops::client('');
```

### Contacts

[](#contacts)

#### Create a new contact

[](#create-a-new-contact)

```
$response = $loops->contacts()->create([
    'email' => 'john@example.com',
    'firstName' => 'John',
]);
```

You can access the properties of the response:

```
$response->success;
$response->id;
$response->message;
```

[API Reference](https://loops.so/docs/api-reference/create-contact)

#### Retrieve a contact

[](#retrieve-a-contact)

```
$contact = $loops->contacts()->retrieve('john@example.com');
```

You can access the properties of the contact:

```
$contact->email;
$contact->firstName;
$contact->id;
$contact->lastName;
$contact->source;
$contact->subscribed;
$contact->userGroup;
$contact->userId;

$contact->favoriteColor; // Custom property
```

[API Reference](https://loops.so/docs/api-reference/find-contact)

#### Update a contact

[](#update-a-contact)

```
$response = $loops->contacts()->update('john@example.com', [
    'firstName' => 'John',
]);
```

You can access the properties of the response:

```
$response->success;
$response->id;
$response->message;
```

[API Reference](https://loops.so/docs/api-reference/update-contact)

#### Delete a contact

[](#delete-a-contact)

```
$loops->contacts()->delete(email: 'john@example.com');
```

Alternatively, you can delete a contact by its userId:

```
$loops->contacts()->delete(userId: 'asdf');
```

You can access the properties of the response:

```
$response->message;
$response->success;
```

[API Reference](https://loops.so/docs/api-reference/delete-contact)

#### Custom fields

[](#custom-fields)

```
$fields = $loops->contacts()->customFields();
```

You can access the properties of the response:

```
foreach ($fields as $field) {
    $field->key;
    $field->label;
    $field->type;
}
```

[API Reference](https://loops.so/docs/api-reference/list-custom-fields)

Events
------

[](#events)

### Send event

[](#send-event)

```
$response = $loops->events()->send(
    eventName: 'signup',
    email: 'john@example.com',
    properties: [
        'firstName' => 'John',
    ]
);
```

You can access the properties of the response:

```
$response->success;
$response->message;
```

[API Reference](https://loops.so/docs/api-reference/send-event)

Transactional emails
--------------------

[](#transactional-emails)

### Send transactional email

[](#send-transactional-email)

```
$response = $loops->transactional()->send(
    transactionalId: 'asdf',
    email: 'john@example.com',
    dataVariables: [
        'url' => 'https://example.com',
    ],
    attachments: [
        [
            'contentType' => 'application/pdf',
            'data' => '/9j/4AAQSkZJRgABAQEASABIAAD/4...',
            'filename' => 'file.pdf',
        ],
    ]
);
```

You can access the properties of the response:

```
$response->success;
$response->error;
$response->message;
$response->path;
$response->transactionalId;
```

It's necessary to check for errors in different places due to the difference error responses from the Loops API.

[API Reference](https://loops.so/docs/api-reference/send-transactional-email)

Credits
-------

[](#credits)

- [Hosmel Quintana](https://github.com/hosmelq)
- [All Contributors](../../contributors)

License
-------

[](#license)

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

###  Health Score

39

—

LowBetter than 86% of packages

Maintenance56

Moderate activity, may be stable

Popularity33

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 77.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 ~252 days

Total

3

Last Release

294d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/97fd048037c6d5ccfeebf11961838d5db2dca1baca14fefa373230b301389a03?d=identicon)[hosmelq](/maintainers/hosmelq)

---

Top Contributors

[![hosmelq](https://avatars.githubusercontent.com/u/1166143?v=4)](https://github.com/hosmelq "hosmelq (7 commits)")[![HelgeSverre](https://avatars.githubusercontent.com/u/1089652?v=4)](https://github.com/HelgeSverre "HelgeSverre (1 commits)")[![jorisvanandel](https://avatars.githubusercontent.com/u/25010850?v=4)](https://github.com/jorisvanandel "jorisvanandel (1 commits)")

---

Tags

emailloopsmarketingphptransactionalphpemailmarketingtransactionalloopsplutolinks

###  Code Quality

TestsPest

Static AnalysisPHPStan, Rector

Code StyleLaravel Pint

Type Coverage Yes

### Embed Badge

![Health badge](/badges/plutolinks-loops/health.svg)

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

###  Alternatives

[mailerlite/mailerlite-api-v2-php-sdk

MailerLite API v2 PHP SDK

801.7M15](/packages/mailerlite-mailerlite-api-v2-php-sdk)[bentonow/bento-laravel-sdk

Laravel SDK for Bento

2338.5k1](/packages/bentonow-bento-laravel-sdk)[henrique-borba/php-sieve-manager

A modern (started in 2022) PHP library for the ManageSieve protocol (RFC5804) to create/edit Sieve scripts (RFC5228). Used by Cypht Webmail.

23125.7k2](/packages/henrique-borba-php-sieve-manager)

PHPackages © 2026

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