定制 beholdr/sendsay-laravel 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

beholdr/sendsay-laravel

最新稳定版本:v0.1.3

Composer 安装命令:

composer require beholdr/sendsay-laravel

包简介

Unofficial Sendsay.ru mailer transport for Laravel to sending transactional emails.

README 文档

README

Latest Version on Packagist

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:

  1. Publish laravel-mail components:
php artisan vendor:publish --tag=laravel-mail
  1. Add to html footer template code:
@aware(['unsubscribe'])

...

@if ($unsubscribe)
<a style="font-size: 12px" href="{{ $unsubscribe }}">{{ __('Unsubscribe') }}</a>
@endif
  1. Add to text footer template code:
@aware(['unsubscribe'])

...

@if ($unsubscribe)
{{ __('Unsubscribe') }}: {{ $unsubscribe }}
@endif
  1. Pass unsubscribe prop to x-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.

统计信息

  • 总下载量: 3.12k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-11-28