Skip to content

Commit

Permalink
feat: add more webhook consumers
Browse files Browse the repository at this point in the history
  • Loading branch information
maelgangloff committed Aug 27, 2024
1 parent 0d8c572 commit 4b0148f
Show file tree
Hide file tree
Showing 5 changed files with 248 additions and 2 deletions.
3 changes: 3 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
"symfony/discord-notifier": "7.1.*",
"symfony/doctrine-messenger": "7.1.*",
"symfony/dotenv": "7.1.*",
"symfony/engagespot-notifier": "7.1.*",
"symfony/expression-language": "7.1.*",
"symfony/flex": "^2",
"symfony/form": "7.1.*",
Expand All @@ -59,9 +60,11 @@
"symfony/mime": "7.1.*",
"symfony/monolog-bundle": "^3.0",
"symfony/notifier": "7.1.*",
"symfony/ntfy-notifier": "7.1.*",
"symfony/process": "7.1.*",
"symfony/property-access": "7.1.*",
"symfony/property-info": "7.1.*",
"symfony/pushover-notifier": "7.1.*",
"symfony/rate-limiter": "7.1.*",
"symfony/redis-messenger": "7.1.*",
"symfony/rocket-chat-notifier": "7.1.*",
Expand Down
207 changes: 206 additions & 1 deletion composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions config/packages/notifier.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ framework:
googlechat: '%env(GOOGLE_CHAT_DSN)%'
discord: '%env(DISCORD_DSN)%'
texter_transports:
engagespot: '%env(ENGAGESPOT_DSN)%'
pushover: '%env(PUSHOVER_DSN)%'
channel_policy:
# use chat/slack, chat/telegram, sms/twilio or sms/nexmo
urgent: ['email']
Expand Down
11 changes: 10 additions & 1 deletion src/Config/WebhookScheme.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,12 @@
namespace App\Config;

use Symfony\Component\Notifier\Bridge\Discord\DiscordTransportFactory;
use Symfony\Component\Notifier\Bridge\Engagespot\EngagespotTransportFactory;
use Symfony\Component\Notifier\Bridge\GoogleChat\GoogleChatTransportFactory;
use Symfony\Component\Notifier\Bridge\Mattermost\MattermostTransportFactory;
use Symfony\Component\Notifier\Bridge\MicrosoftTeams\MicrosoftTeamsTransportFactory;
use Symfony\Component\Notifier\Bridge\Ntfy\NtfyTransportFactory;
use Symfony\Component\Notifier\Bridge\Pushover\PushoverTransportFactory;
use Symfony\Component\Notifier\Bridge\RocketChat\RocketChatTransportFactory;
use Symfony\Component\Notifier\Bridge\Slack\SlackTransportFactory;
use Symfony\Component\Notifier\Bridge\Telegram\TelegramTransportFactory;
Expand All @@ -21,6 +24,9 @@ enum WebhookScheme: string
case SLACK = 'slack';
case TELEGRAM = 'telegram';
case ZULIP = 'zulip';
case PUSHOVER = 'pushover';
case NTFY = 'ntfy';
case ENGAGESPOT = 'engagespot';

public function getChatTransportFactory(): string
{
Expand All @@ -32,7 +38,10 @@ public function getChatTransportFactory(): string
WebhookScheme::ROCKET_CHAT => RocketChatTransportFactory::class,
WebhookScheme::SLACK => SlackTransportFactory::class,
WebhookScheme::TELEGRAM => TelegramTransportFactory::class,
WebhookScheme::ZULIP => ZulipTransportFactory::class
WebhookScheme::ZULIP => ZulipTransportFactory::class,
WebhookScheme::PUSHOVER => PushoverTransportFactory::class,
WebhookScheme::NTFY => NtfyTransportFactory::class,
WebhookScheme::ENGAGESPOT => EngagespotTransportFactory::class
};
}
}
27 changes: 27 additions & 0 deletions symfony.lock
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,15 @@
"ref": "b97655f9a2fb8fc04d9f4081e0b5599d897b7f6e"
}
},
"symfony/engagespot-notifier": {
"version": "7.1",
"recipe": {
"repo": "github.com/symfony/recipes",
"branch": "main",
"version": "6.1",
"ref": "99e2d9bebabbc56ec54bc93278989853ea6c9256"
}
},
"symfony/flex": {
"version": "2.4",
"recipe": {
Expand Down Expand Up @@ -289,6 +298,15 @@
"config/packages/notifier.yaml"
]
},
"symfony/ntfy-notifier": {
"version": "7.1",
"recipe": {
"repo": "github.com/symfony/recipes",
"branch": "main",
"version": "6.4",
"ref": "0d5e496659d7361bb4e6648eb8332f8cf097533d"
}
},
"symfony/phpunit-bridge": {
"version": "7.1",
"recipe": {
Expand All @@ -304,6 +322,15 @@
"tests/bootstrap.php"
]
},
"symfony/pushover-notifier": {
"version": "7.1",
"recipe": {
"repo": "github.com/symfony/recipes",
"branch": "main",
"version": "6.3",
"ref": "b9dc3c716eb686c267d767eb3c78ad47c11c34cb"
}
},
"symfony/rocket-chat-notifier": {
"version": "7.1",
"recipe": {
Expand Down

0 comments on commit 4b0148f

Please sign in to comment.