LaravelPackages.net
Acme Inc.
Toggle sidebar
overtrue/laravel-sendcloud

SendCloud SDK for Laravel.

856
20
2.0.0
About overtrue/laravel-sendcloud

overtrue/laravel-sendcloud is a Laravel package for sendcloud sdk for laravel.. It currently has 20 GitHub stars and 856 downloads on Packagist (latest version 2.0.0). Install it with composer require overtrue/laravel-sendcloud. Discover more Laravel packages by overtrue or browse all Laravel packages to compare alternatives.

Last updated

Laravel SendCloud

SendCloud API SDK bindings for Laravel. This package does not register a Laravel Mail transport.

GitHub release (latest SemVer) GitHub License Packagist Downloads

Sponsor me

Requirements

  • PHP 8.3 or newer (PHP 8.x)
  • Laravel 13.30 or newer (Laravel 13.x)
  • SendCloud SDK 2.x

See UPGRADE.md when upgrading from 1.x.

Installing

$ composer require overtrue/laravel-sendcloud:^2.0

Usage

  1. config your apiUser and apiKey into config/services.php:
    //...
    
    'sendcloud' => [
        'api_user' => env('SENDCLOUD_API_USER', ''),
        'api_key'  => env('SENDCLOUD_API_KEY', ''),
    ],
  1. Call SendCloud API:
$result = SendCloud::post('/mail/send', [
                'from' => '[email protected]',
                'to' => '[email protected]',
                'subject' => '来自 SendCloud 的第一封邮件!',
                'html' => '你太棒了!你已成功的 从SendCloud 发送了一封测试邮件!',
            ]);
            
// or 

$result = app('sendcloud')->get('addresslist/list');

Configuration and lifecycle

Additional SDK options such as timeout, connect_timeout, response_type, and base_uri can be added directly to services.sendcloud. Keep custom API endpoints on HTTPS. Credentials are checked when the client is resolved, so booting the application does not require them.

The class binding and app('sendcloud') create a fresh client on each resolution. Laravel facades cache their resolved client until Laravel clears the facade state; configuration changes do not update an already resolved client. Resolve a fresh client after changing configuration. Long-running workers must manage their application and facade lifecycle; Octane compatibility is not claimed by this package.

Testing

composer install
composer validate --strict
composer lint
composer test
composer audit

Tests use Orchestra Testbench and a mocked HTTP transport. No SendCloud account or live API requests are needed. CI checks PHP 8.3, 8.4, and 8.5 plus the lowest secure dependency graph.

Documentation

:heart: Sponsor me

Sponsor me

如果你喜欢我的项目并想支持它,点击这里 :heart:

Project supported by JetBrains

Many thanks to Jetbrains for kindly providing a license for me to work on this and other open-source projects.

License

MIT

Comments