symfony/prelude-notifier
最新稳定版本:v8.1.0-BETA1
Composer 安装命令:
composer require symfony/prelude-notifier
包简介
Symfony Prelude Notifier Bridge
README 文档
README
The prelude-notifier package provides a Prelude bridge for Symfony Notifier.
Installation
composer require symfony/prelude-notifier
Configuration
-
Register the bundle in your application (if not using Symfony Flex).
-
Configure the DSN in your
.envfile:# API Key is required # Sender ID is optional (can be set in options or DSN) PRELUDE_DSN=prelude://YOUR_API_KEY@default?sender=YOUR_SENDER_ID
Usage
The Prelude Notify API requires a template_id. You must use PreludeOptions to provide it.
use Symfony\Component\Notifier\Message\SmsMessage; use Symfony\Component\Notifier\Bridge\Prelude\PreludeOptions; $options = new PreludeOptions( templateId: 'template_01k8xxxxxxxxxxxxx', // Required variables: [ 'order_id' => '12345', 'amount' => '$49.99', ], // Optional parameters // from: 'MySenderID', // locale: 'fr-FR', // callbackUrl: 'https://example.com/webhook', // preferredChannel: 'whatsapp' ); $message = (new SmsMessage('+33612345678', 'Subject (ignored)')) ->options($options); $notifier->send($message);
Options
templateId(string, required): The template identifier.variables(array): Key-value pairs for template variables.from(string): The Sender ID.locale(string): BCP-47 formatted locale string.expiresAt(string): Message expiration date (RFC3339).scheduleAt(string): Schedule delivery time (RFC3339).callbackUrl(string): URL for delivery events.correlationId(string): User-defined identifier.preferredChannel(string): 'sms' or 'whatsapp'.
统计信息
- 总下载量: 1
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 12
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-04-30