ethercreative / yii2-sendgrid-unsubscribe
该软件包已被废弃且不再维护。未建议替代软件包。
一个用于轻松提供带抑制组支持的公共退订网址的 Yii2 模块。
1.0.0
2016-03-16 14:29 UTC
Requires
This package is not auto-updated.
Last update: 2020-01-22 01:59:00 UTC
README
一个用于轻松提供带抑制组支持的公共退订网址的 Yii2 模块。
安装
安装此扩展的首选方式是通过 composer。
运行以下命令之一
php composer.phar require ethercretaive/yii2-sendgrid-unsubscribe "~1.0.0"
或将其添加到您的 composer.json
文件的 require 部分。
"ethercreative/yii2-sendgrid-unsubscribe": "~1.0.0"
使用
使用方法
此插件假设您正在使用 shershennm/yii2-sendgrid
扩展安装后,只需按以下方式修改您的应用程序配置
return [ 'modules' => [ 'unsubscribe' => [ 'class' => 'ethercreative\unsubscribe\Module', // the following are optional // default group to unsubscribe from 'default' => 70, // flash message options 'flashMessage' => 'Your email address has successfully been unsubscribed', 'flashGroup' => 'unsubscribe-success', // where to redirect to, after success // defaults to `Url::home()` 'redirect' => ['/site/login'], // if you want to hide the IDs of your suppression groups, use `groups` to convert // the following will allow you to use // `?email=email@address.com&group=messages` // `?email=email@address.com&group=Y30JOMJjA7V7bcAC` 'groups' => [ 'messages' => 70, 'Y30JOMJjA7V7bcAC' => 80, ], ], // ... ], // ... ];
然后您可以生成指向 /unsubscribe/?email={email}&group={id/key}
的链接
Url::to(['/unsubscribe', 'email' => $email, 'group' => $group], true);