Skip to content

[Notifier] Fix documentation symfony notifier #16906

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 11, 2022

Conversation

matthieudelmas
Copy link
Contributor

@matthieudelmas matthieudelmas commented Jun 22, 2022

Hi there 👋

After following the notifier doc 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"
    image
  • when i dump the created ChatMessage, i see that the notification is empty.
    image

=> 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)

@carsonbot carsonbot added this to the 6.2 milestone Jun 22, 2022
@carsonbot carsonbot changed the title Fix documentation symfony notifier [Notifier] Fix documentation symfony notifier Jul 11, 2022
@javiereguiluz javiereguiluz modified the milestones: 6.2, 4.4, 5.4 Jul 11, 2022
Fix empty notification in ChatMessage when message customization
@javiereguiluz
Copy link
Member

Thanks Matthieu ... and congrats on your first Symfony Docs contribution 🎉

@javiereguiluz javiereguiluz merged commit dfa57c5 into symfony:5.4 Jul 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants