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 @@ -697,7 +697,7 @@ and its ``asChatMessage()`` method::
697697 use Symfony\Component\Notifier\Message\ChatMessage;
698698 use Symfony\Component\Notifier\Notification\ChatNotificationInterface;
699699 use Symfony\Component\Notifier\Notification\Notification;
700- use Symfony\Component\Notifier\Recipient\SmsRecipientInterface ;
700+ use Symfony\Component\Notifier\Recipient\RecipientInterface ;
701701
702702 class InvoiceNotification extends Notification implements ChatNotificationInterface
703703 {
@@ -710,10 +710,11 @@ and its ``asChatMessage()`` method::
710710
711711 public function asChatMessage(RecipientInterface $recipient, string $transport = null): ?ChatMessage
712712 {
713- // Add a custom emoji if the message is sent to Slack
713+ // Add a custom subject and emoji if the message is sent to Slack
714714 if ('slack' === $transport) {
715- return (new ChatMessage('You\'re invoiced '.$this->price.' EUR.'))
716- ->emoji('money');
715+ $this->subject('You\'re invoiced '.strval($this->price).' EUR.');
716+ $this->emoji("money");
717+ return ChatMessage::fromNotification($this);
717718 }
718719
719720 // If you return null, the Notifier will create the ChatMessage
You can’t perform that action at this time.
0 commit comments