File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -657,7 +657,7 @@ and its ``asChatMessage()`` method::
657657 use Symfony\Component\Notifier\Message\ChatMessage;
658658 use Symfony\Component\Notifier\Notification\ChatNotificationInterface;
659659 use Symfony\Component\Notifier\Notification\Notification;
660- use Symfony\Component\Notifier\Recipient\SmsRecipientInterface ;
660+ use Symfony\Component\Notifier\Recipient\RecipientInterface ;
661661
662662 class InvoiceNotification extends Notification implements ChatNotificationInterface
663663 {
@@ -670,10 +670,11 @@ and its ``asChatMessage()`` method::
670670
671671 public function asChatMessage(RecipientInterface $recipient, string $transport = null): ?ChatMessage
672672 {
673- // Add a custom emoji if the message is sent to Slack
673+ // Add a custom subject and emoji if the message is sent to Slack
674674 if ('slack' === $transport) {
675- return (new ChatMessage('You\'re invoiced '.$this->price.' EUR.'))
676- ->emoji('money');
675+ $this->subject('You\'re invoiced '.strval($this->price).' EUR.');
676+ $this->emoji("money");
677+ return ChatMessage::fromNotification($this);
677678 }
678679
679680 // If you return null, the Notifier will create the ChatMessage
You can’t perform that action at this time.
0 commit comments