Add Mattermost notification channel support
Introduces Mattermost as a new notification channel, including backend service integration, controller validation, UI form fields, and updates to channel type enums in the database schema and migrations. This enables users to configure and send notifications via Mattermost webhooks.
This commit is contained in:
@@ -463,7 +463,9 @@ class NotificationGroupController extends Controller
|
||||
'email' => 'Email',
|
||||
'telegram' => 'Telegram',
|
||||
'discord' => 'Discord',
|
||||
'slack' => 'Slack'
|
||||
'slack' => 'Slack',
|
||||
'mattermost' => 'Mattermost',
|
||||
'webhook' => 'Webhook'
|
||||
];
|
||||
|
||||
$channelName = $channelNames[$channelType] ?? ucfirst($channelType);
|
||||
@@ -532,6 +534,17 @@ class NotificationGroupController extends Controller
|
||||
}
|
||||
return ['webhook_url' => $webhookUrl];
|
||||
|
||||
case 'mattermost':
|
||||
$webhookUrl = trim($data['mattermost_webhook_url'] ?? '');
|
||||
if (empty($webhookUrl) || !filter_var($webhookUrl, FILTER_VALIDATE_URL)) {
|
||||
return null;
|
||||
}
|
||||
// Validate Mattermost webhook URL format
|
||||
if (!str_contains($webhookUrl, '/hooks/')) {
|
||||
return null;
|
||||
}
|
||||
return ['webhook_url' => $webhookUrl];
|
||||
|
||||
case 'webhook':
|
||||
$webhookUrl = trim($data['webhook_url'] ?? '');
|
||||
if (empty($webhookUrl) || !filter_var($webhookUrl, FILTER_VALIDATE_URL)) {
|
||||
|
||||
Reference in New Issue
Block a user