beholdr / sendsay-laravel
Unofficial Sendsay.ru mailer transport for Laravel to sending transactional emails.
Requires
- php: ^8.1
- illuminate/contracts: ^10.0 || ^11.0
- spatie/laravel-package-tools: ^1.14.0
Requires (Dev)
- laravel/pint: ^1.0
- nunomaduro/collision: ^7.8
- nunomaduro/larastan: ^2.0.1
- orchestra/testbench: ^8.8
- pestphp/pest: ^2.20
- pestphp/pest-plugin-arch: ^2.0
- pestphp/pest-plugin-laravel: ^2.0
- phpstan/extension-installer: ^1.1
- phpstan/phpstan-deprecation-rules: ^1.0
- phpstan/phpstan-phpunit: ^1.0
README
Unofficial Sendsay.ru mailer transport for Laravel to sending transactional emails.
Support
Do you like Sendsay Laravel? Please support me via Boosty.
Installation
You can install the package via composer:
composer require beholdr/sendsay-laravel
You need to set .env
variables:
MAIL_SENDSAY_ACCOUNT="root_account_name" MAIL_SENDSAY_KEY="YOUR_API_KEY"
And add mailer transport in config/mail.php
:
'mailers' => [ ... 'sendsay' => [ 'transport' => 'sendsay', ], ]
Optionally, you can publish the config file with:
php artisan vendor:publish --tag="sendsay-config"
Usage
Unsubscribe link
For better user experience you should provide unsubscribe link in your emails. You can add such link, using special code #UNSUBSCRIBE_LINK#
in your templates, that will be substituted with a real url.
For example, if you are using markdown mailables:
- Publish laravel-mail components:
php artisan vendor:publish --tag=laravel-mail
- Add to html footer template code:
@aware(['unsubscribe']) ... @if ($unsubscribe) <a style="font-size: 12px" href="{{ $unsubscribe }}">{{ __('Unsubscribe') }}</a> @endif
- Add to text footer template code:
@aware(['unsubscribe']) ... @if ($unsubscribe) {{ __('Unsubscribe') }}: {{ $unsubscribe }} @endif
- Pass
unsubscribe
prop tox-mail::message
component in letter template:
<x-mail::message :unsubscribe="$mailer === 'sendsay' ? '#UNSUBSCRIBE_LINK#' : false"> ... </x-mail::message>
Proxy
If you set APP_LOCAL_PROXY
variable, your requests to Sendsay.ru will be proxified via given proxy. Example for proxy inside Docker:
APP_LOCAL_PROXY="socks5://host.docker.internal:8123"
Testing
composer test
License
The MIT License (MIT). Please see License File for more information.