From ed48b158d9ed1b6c6df5d34b9913c408df0c2bcd Mon Sep 17 00:00:00 2001 From: Stefan Wienert Date: Sun, 6 Oct 2019 21:37:26 +0200 Subject: [PATCH] Adds support for configurable channel --- sentry_mattermost/plugin.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sentry_mattermost/plugin.py b/sentry_mattermost/plugin.py index 8c9a344..9980a05 100644 --- a/sentry_mattermost/plugin.py +++ b/sentry_mattermost/plugin.py @@ -84,6 +84,8 @@ def create(cls, plugin, notification): "icon_url": "https://myovchev.github.io/sentry-slack/images/logo32.png", #noqa "text": text } + if plugin.get_option('channel', project): + payload["channel"] = plugin.get_option('channel', project) return payload @@ -99,6 +101,10 @@ class MattermostOptionsForm(notify.NotificationConfigurationForm): help_text='Incoming Webhook URL', widget=forms.URLInput(attrs={'class': 'span8'}) ) + channel = forms.CharField( + help_text='Mattermost channel name, leave empty for default channel defined by webhook', + widget=forms.TextInput(attrs={'class': 'span8'}) + ) include_rules = forms.BooleanField( help_text='Include triggering rules with notifications', required=False,