Commit dfa57c5
committed
minor #16906 [Notifier] Fix documentation symfony notifier (matthieudelmas)
This PR was submitted for the 6.2 branch but it was merged into the 5.4 branch instead.
Discussion
----------
[Notifier] Fix documentation symfony notifier
Hi there 👋
After following [the notifier doc](https://symfony.com/doc/current/notifier.html#customize-notification-messages) to send slack notifications, I think there is a problem at the message customization step :
- I successfully get a slack notification, but when we go to the "Notifications" tab of the Symfony profiler I have an error message "`Impossible to invoke a method ("getSubject") on a variable null" `

- when i dump the created ChatMessage, i see that the notification is empty.

=> Reading the ChatMessage class, it seems that the static method **fromNotification** can solves this problem _(check PR proposal)_
The other fixes are more obvious:
- use RecipientInterface instead of SmsRecipientInterface since in the asChatMessage we use the RecipientInterface
- strval on price in the message since price is an integer
- method emoji on notification not on ChatMessage as the doc is telling us
_(FYI this is my first public PR on github)_
<!--
If your pull request fixes a BUG, use the oldest maintained branch that contains
the bug (see https://symfony.com/releases for the list of maintained branches).
If your pull request documents a NEW FEATURE, use the same Symfony branch where
the feature was introduced (and `6.x` for features of unreleased versions).
-->
Commits
-------
71ff918 Fix documentation symfony notifier1 file changed
+5
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
697 | 697 | | |
698 | 698 | | |
699 | 699 | | |
700 | | - | |
| 700 | + | |
701 | 701 | | |
702 | 702 | | |
703 | 703 | | |
| |||
710 | 710 | | |
711 | 711 | | |
712 | 712 | | |
713 | | - | |
| 713 | + | |
714 | 714 | | |
715 | | - | |
716 | | - | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
717 | 718 | | |
718 | 719 | | |
719 | 720 | | |
| |||
0 commit comments