lettermint / lettermint-php
Official Lettermint PHP SDK.
0.1.1
2025-04-26 11:31 UTC
Requires
- php: ^8.2
- guzzlehttp/guzzle: ^7.9
Requires (Dev)
- larastan/larastan: ^2.9||^3.0
- laravel/pint: ^1.14
- nunomaduro/collision: ^8.1.1||^7.10.0
- orchestra/testbench: ^10.0.0||^9.0.0||^8.22.0
- pestphp/pest: ^3.0
- pestphp/pest-plugin-arch: ^3.0
- pestphp/pest-plugin-laravel: ^3.0
- phpstan/extension-installer: ^1.3||^2.0
- phpstan/phpstan-deprecation-rules: ^1.1||^2.0
- phpstan/phpstan-phpunit: ^1.3||^2.0
README
Integrate Lettermint in your PHP project.
Requirements
- PHP 8.2 or higher
- Composer
Installation
You can install the package via composer:
composer require lettermint/lettermint-php
Usage
Initialize the Lettermint client with your API token:
$lettermint = new Lettermint\Lettermint('your-api-token');
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 <john@example.com>') ->to('recipient1@example.com', 'recipient2@example.com') ->cc('cc@example.com') ->bcc('bcc@example.com') ->replyTo('reply@example.com') ->subject('Hello world!') ->html('<h1>Hello!</h1>') ->text('Hello!') ->headers(['X-Custom-Header' => 'Value']) ->attach('document.pdf', base64_encode($fileContent)) ->send();
Testing
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.