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,