Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/symfony/novu-notifier
Provides Novu integration for Symfony Notifier.
https://github.com/symfony/novu-notifier
component notifier novu php symfony symfony-component
Last synced: about 1 month ago
JSON representation
Provides Novu integration for Symfony Notifier.
- Host: GitHub
- URL: https://github.com/symfony/novu-notifier
- Owner: symfony
- License: mit
- Created: 2023-06-20T15:19:15.000Z (over 1 year ago)
- Default Branch: 7.1
- Last Pushed: 2024-09-27T08:44:04.000Z (about 2 months ago)
- Last Synced: 2024-09-30T16:03:17.285Z (about 2 months ago)
- Topics: component, notifier, novu, php, symfony, symfony-component
- Language: PHP
- Homepage: https://symfony.com/notifier
- Size: 42 KB
- Stars: 4
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
Novu Notifier
=============Provides [Novu](https://novu.co/) integration for Symfony Notifier.
DSN example
-----------```
NOVU_DSN=novu://API_KEY@default
```Notification example
--------------------```php
class NovuNotification extends Notification implements PushNotificationInterface
{
public function asPushMessage(
NovuSubscriberRecipient|RecipientInterface $recipient,
?string $transport = null,
): ?PushMessage {
return new PushMessage(
$this->getSubject(),
$this->getContent(),
new NovuOptions(
$recipient->getSubscriberId(),
$recipient->getFirstName(),
$recipient->getLastName(),
$recipient->getEmail(),
$recipient->getPhone(),
$recipient->getAvatar(),
$recipient->getLocale(),
$recipient->getOverrides(),
[],
),
);
}
}
``````php
$notification = new NovuNotification;
$notification->subject('test');
$notification->channels(['push']);
$notification->content(
json_encode(
[
'param1' => 'Lorum Ipsum',
]
)
);$this->notifier->send(
$notification,
new NovuSubscriberRecipient(
"123",
'Wouter',
'van der Loop',
'[email protected]',
null,
null,
null,
[
'email' => [
'from' => '[email protected]',
'senderName' => 'No-Reply',
],
],
),
);
```Resources
---------* [Contributing](https://symfony.com/doc/current/contributing/index.html)
* [Report issues](https://github.com/symfony/symfony/issues) and
[send Pull Requests](https://github.com/symfony/symfony/pulls)
in the [main Symfony repository](https://github.com/symfony/symfony)