Skip to content

Added slack webhook notification functionality #65

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 4 commits into from
Mar 27, 2023

Conversation

sheldor1510
Copy link
Collaborator

  • Created new library UnityWebhook to send notifications to admins on slack channel
  • Gets the template from the mail directory, converts into markdown format required by slack
  • Delivered message looks like:
    image
  • Add slack webhook for admin notifications #37

@sheldor1510 sheldor1510 requested a review from hakasapl March 26, 2023 22:48
Copy link
Collaborator

@hakasapl hakasapl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good as is, but it would be good to use this library instead: https://github.com/Elephant418/Markdownify

The package will need to be added to the composer.json file. This way, it will support any future HTML we decide to convert to markdown rather than having to homebrew the conversion for every case.

@sheldor1510
Copy link
Collaborator Author

sheldor1510 commented Mar 27, 2023

@hakasapl I tried this package along with https://github.com/thephpleague/html-to-markdown as well but it turns out Slack has a different way of formatting markdown content with for bold, links, and other tags. So any package will always be giving the incorrect text back, so I decided to make the function myself and I think it will be easy to update it if further changes are made for the templates.

Copy link
Collaborator

@hakasapl hakasapl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, yes, I see what you mean now. This looks good then, I'll go ahead and merge. Thank you!

@hakasapl hakasapl merged commit cd11d55 into UnityHPC:main Mar 27, 2023
@sheldor1510 sheldor1510 deleted the slack-webhook branch March 27, 2023 21:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants