x-one / smsplanet-notifier-bundle
此包的最新版本(v1.0.0)没有提供许可证信息。
将SMSPLANET提供商与Symfony Notifier集成
v1.0.0
2023-11-14 09:30 UTC
Requires
- php: ^8.1
- symfony/framework-bundle: ^6.2
- symfony/http-client: ^6.2
- symfony/notifier: ^6.2
- symfony/property-access: ^6.2
Requires (Dev)
- symfony/mailer: ^6.2
- symfony/mime: ^6.2
- symfony/phpunit-bridge: ^6.2
This package is auto-updated.
Last update: 2024-09-14 15:16:44 UTC
README
为Symfony Notifier提供SMSPLANET集成。
composer require x-one/smsplanet-notifier-bundle
DSN示例
SMSPLANET_DSN=smsplanet://KEY:PASSWORD@default?from=FROM&test=TEST
其中
KEY
是您的API密钥(令牌)PASSWORD
是您的API密码TEST
将此参数设置为“1”(默认“0”)将导致以测试模式发送消息(消息将被验证,但不会发送)
请在https://panel.smsplanet.pl/查看您的账户信息。
向消息添加选项
您可以使用SmsplanetOptions
类来添加消息选项
use Symfony\Component\Notifier\Message\SmsMessage;
use Symfony\Component\Notifier\TexterInterface;
use XOne\Bundle\NotifierBundle\SmsplanetOptions;
$sms = new SmsMessage('+4811111111', 'My message');
$options = (new SmsplanetOptions())
->date((new DateTime())->modify('+1 hour'))
->name('Start systemu')
->clearPolish(true)
->param1(['Jan', 'Zbigniew', 'Jerzy'])
->param2(['Kowalski', 'Nowak', 'Wiśniewski'])
->param3(['54-152', '43-190', '60-118'])
->param4(['Wrocław', 'Mikołów', 'Poznań'])
->companyId('A005')
->transactional(true)
;
// Add the custom options to the sms message and send the message
$sms->options($options);
/**
* @var TexterInterface $texter
*/
$texter->send($sms);