ghanover / mailman-sync
与mailman列表同步
1.0.0
2018-09-09 02:24 UTC
Requires
- php: >=7.0
- guzzlehttp/guzzle: ^6.3
- illuminate/support: >=5.1
Requires (Dev)
- orchestra/testbench: ~3.1
- phpunit/phpunit: ^6.0
This package is auto-updated.
Last update: 2024-09-07 15:43:31 UTC
README
介绍
提供基本的订阅/取消订阅功能,以允许用户列表与mailman列表保持同步
安装
通过composer安装(直到我从懒惰中振作起来将其添加到packagist,您将需要手动添加VCS)
composer require ghanover/mailman-sync
或者手动编辑您的composer.json文件
"require": {
"ghanover/mailman-sync": "dev-master"
}
发布配置文件
php artisan vendor:publish
app/config.php
编辑aliases数组以包含
'MailmanGateway' => \MailmanSync\Facades\MailmanGateway::class,
在providers数组中注册服务提供者
\MailmanSync\SyncServiceProvider::class,
配置
MAILMAN_ADMIN_URL=http://your.host/mailman/
MAILMAN_LISTS="{\"examplelist\":{\"password\":\"securepassword\"}}"
使用方法
基本示例
MailmanGateway::subscribe('mylist', 'user@example.com');
测试
您可以通过在.env中添加MAILMAN_MOCK=true来在本地测试而无需设置mailman。这将使用存储在storage/app/中的本地文件来模拟成员列表。
目前,模拟功能还没有测试失败的方法。