PHPackages                             lettermint/lettermint-php - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. lettermint/lettermint-php

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

lettermint/lettermint-php
=========================

Official Lettermint PHP SDK.

1.5.1(4mo ago)429.2k↑14.3%[1 issues](https://github.com/lettermint/lettermint-php/issues)[2 PRs](https://github.com/lettermint/lettermint-php/pulls)2MITPHPPHP ^8.2CI passing

Since Apr 21Pushed 1mo agoCompare

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

READMEChangelog (10)Dependencies (11)Versions (17)Used By (2)

Lettermint PHP SDK
==================

[](#lettermint-php-sdk)

[![Latest Version on Packagist](https://camo.githubusercontent.com/d2fc251672a469823fcb318c37e9ae165de52d9d7acfd4ff0f0963132ec956e9/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6c65747465726d696e742f6c65747465726d696e742d7068702e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/lettermint/lettermint-php)[![GitHub Tests Action Status](https://camo.githubusercontent.com/3e97bf8347754aa96285c7f83e0af7da601b503d326e438c8c9eed2408da0969/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6c65747465726d696e742f6c65747465726d696e742d7068702f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/lettermint/lettermint-php/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/ef32f9a4a535e5fcc21c0d57bce4c8518dd36f83d713791ca61ed21d35f9aab1/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6c65747465726d696e742f6c65747465726d696e742d7068702f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/lettermint/lettermint-php/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/c63fbd9b42b3e4e2f5768e944a792a108d7b533ce14e6323c7502d58b5beff57/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6c65747465726d696e742f6c65747465726d696e742d7068702e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/lettermint/lettermint-php)[![Join our Discord server](https://camo.githubusercontent.com/53ac78394b2bfdedbab92b06b9aa0593d5334263ac202bcb761913f2cbde04c3/68747470733a2f2f696d672e736869656c64732e696f2f646973636f72642f313330353531303039353538383831393033353f6c6f676f3d646973636f7264266c6f676f436f6c6f723d656565266c6162656c3d446973636f7264266c6162656c436f6c6f723d34363463653526636f6c6f723d3044304532382663616368655365636f6e64733d3433323030)](https://lettermint.co/r/discord)

Integrate Lettermint in your PHP project.

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

[](#requirements)

- PHP 8.2 or higher
- Composer

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

[](#installation)

You can install the package via composer:

```
composer require lettermint/lettermint-php
```

Usage
-----

[](#usage)

Initialize the Lettermint client with your API token:

```
$lettermint = new Lettermint\Lettermint('your-api-token');
```

### Sending Emails

[](#sending-emails)

The SDK provides a fluent interface for composing and sending emails:

```
$response = $lettermint->email
                       ->from('sender@example.com')
                       ->to('recipient@example.com')
                       ->subject('Hello from Lettermint!')
                       ->text('Hello! This is a test email.')
                       ->send();
```

The SDK supports various email features:

```
$lettermint->email
    ->from('John Doe ')
    ->to('recipient1@example.com', 'recipient2@example.com')
    ->cc('cc@example.com')
    ->bcc('bcc@example.com')
    ->replyTo('reply@example.com')
    ->subject('Hello world!')
    ->html('Hello!')
    ->text('Hello!')
    ->headers(['X-Custom-Header' => 'Value'])
    ->attach('document.pdf', base64_encode($fileContent))
    ->attach('logo.png', base64_encode($logoContent), 'logo@example.com')
    ->route('my-route-id')
    ->idempotencyKey('unique-request-id-123')
    ->send();
```

#### Inline Attachments

[](#inline-attachments)

You can embed images and other content in your HTML emails using content IDs:

```
$lettermint->email
    ->from('sender@example.com')
    ->to('recipient@example.com')
    ->subject('Email with inline image')
    ->html('Here is an image: ')
    ->attach('logo.png', base64_encode($imageContent), 'logo@example.com')
    ->send();
```

### Idempotency

[](#idempotency)

To ensure that duplicate requests are not processed, you can use an idempotency key:

```
$response = $lettermint->email
                       ->from('sender@example.com')
                       ->to('recipient@example.com')
                       ->subject('Hello from Lettermint!')
                       ->text('Hello! This is a test email.')
                       ->idempotencyKey('unique-request-id-123')
                       ->send();
```

The idempotency key should be a unique string that you generate for each unique email you want to send. If you make the same request with the same idempotency key, the API will return the same response without sending a duplicate email.

For more information, refer to the [documentation](https://docs.lettermint.co/platform/emails/idempotency).

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

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

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

[](#contributing)

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

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [Bjarn Bronsveld](https://github.com/bjarn)
- [All Contributors](../../contributors)

License
-------

[](#license)

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

###  Health Score

49

—

FairBetter than 95% of packages

Maintenance78

Regular maintenance activity

Popularity33

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 77.5% 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 ~20 days

Recently: every ~30 days

Total

13

Last Release

146d ago

Major Versions

0.1.1 → 1.0.02025-06-14

### Community

Maintainers

![](https://www.gravatar.com/avatar/4b21c7b0783f49d47252342dde1bf0395079db0e423f0ee79e82620202355ab2?d=identicon)[bjarn](/maintainers/bjarn)

---

Top Contributors

[![bjarn](https://avatars.githubusercontent.com/u/14638441?v=4)](https://github.com/bjarn "bjarn (31 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (6 commits)")[![Bjornftw](https://avatars.githubusercontent.com/u/2643275?v=4)](https://github.com/Bjornftw "Bjornftw (2 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (1 commits)")

---

Tags

phplettermintlettermint-php

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/lettermint-lettermint-php/health.svg)

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

###  Alternatives

[stevebauman/location

Retrieve a user's location by their IP Address

1.3k7.6M65](/packages/stevebauman-location)[gehrisandro/tailwind-merge-laravel

TailwindMerge for Laravel merges multiple Tailwind CSS classes by automatically resolving conflicts between them

341682.2k18](/packages/gehrisandro-tailwind-merge-laravel)[amirbagh75/smsir-php

Unofficial sms.ir PHP Package

181.2k](/packages/amirbagh75-smsir-php)

PHPackages © 2026

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