Closed
Description
Description
Provide Novu integration for Symfony Notifier.
Example
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(),
[],
),
);
}
}
$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',
'woutervdl@toppy.nl',
null,
null,
null,
),
);