symfony/google-chat-notifier
Symfony Notifier integration for Google Chat. Configure a googlechat:// DSN with access key/token and target space, optionally providing a thread_key to group messages into a single thread.
#oncall with a "Rollback" button) by tying notifications to Laravel/Symfony events or business logic.Laravel Events, Symfony Messenger, or EventDispatcher) to trigger alerts.symfony/slack-notifier, laravel-slack, or native platform channels).google-chat-webhook.google-chat.spatie/laravel-google-chat (though less mature).*"This package automates critical alerts into Google Chat, saving teams 10–20 hours/week on manual notifications while improving response times. Here’s how it drives value:
Why now?
Risk: Minimal. The package is MIT-licensed, Symfony-backed, and requires <1 day to integrate. We can pilot it in DevOps first before rolling out to other teams."*
*"The symfony/google-chat-notifier package gives us a battle-tested, zero-OAuth way to send rich notifications to Google Chat. Here’s why it’s the right choice:
googlechat://KEY:TOKEN@space/thread), eliminating manual OAuth flows.thread_key.| Scenario | Solution |
|---|---|
| Laravel (Events) | Wrap the package in a service provider to bridge Laravel’s Dispatcher to Symfony’s Notifier. |
| Laravel (Queues) | Use the package’s GoogleChatTransport in a custom queue worker. |
| Symfony | Directly integrate into symfony/notifier (e.g., use NotifierInterface). |
| Monolithic Laravel | Extract the HTTP transport logic and mock Symfony dependencies. |
// 1. Install the package (composer require symfony/google-chat-notifier).
// 2. Configure DSN in .env:
// GOOGLE_CHAT_DSN=googlechat://ACCESS_KEY:TOKEN@devops-space/incident-thread
// 3. Dispatch a notification in an Event Listener:
use Symfony\Component\Notifier\Message\ChatMessage;
use Symfony\Component\Notifier\NotifierInterface;
class DeploymentFailedListener {
public function __construct(private NotifierInterface $notifier) {}
public function handle(DeploymentFailed $event) {
$message = new ChatMessage(
'Deployment failed! 🚨',
'thread_123',
['text' => 'Check logs: ' . $event->logUrl]
);
$this->notifier->send($message);
}
}
| Alternative | Pros | Cons |
|---|---|---|
| Custom API Wrapper | Full control | 2–3 weeks of dev time, no threading. |
| Laravel Google Chat | Laravel-native | Less mature, no Symfony optimizations. |
| Slack Notifier | More mature | Doesn’t fit our Google Workspace stack. |
queue:retry or Symfony’s HttpClient middleware.HttpClient in PHPUnit to test notifications without hitting Google Chat.Next Steps:
*"This package enables product-led automation by turning manual processes into self-service workflows. Here’s how to leverage it:
How can I help you explore Laravel packages today?