Update Mattermost transport with configurable author_name (#9759)

Signed-off-by: Misha Komarovskiy <zombah@gmail.com>
This commit is contained in:
Misha Komarovskiy
2019-02-13 00:22:30 +00:00
committed by Tony Murray
parent 2f8964ce27
commit fe4bd2b338

View File

@@ -38,6 +38,7 @@ class Mattermost extends Transport
'username' => $this->config['mattermost-username'],
'icon' => $this->config['mattermost-icon'],
'channel' => $this->config['mattermost-channel'],
'author_name' => $this->config['mattermost-author_name'],
];
return $this->contactMattermost($obj, $mattermost_opts);
@@ -65,7 +66,7 @@ class Mattermost extends Transport
'title' => $obj['title'],
'text' => $obj['msg'],
'mrkdwn_in' => ['text', 'fallback'],
'author_name' => $obj['hostname'],
'author_name' => $api['author_name'],
],
],
'channel' => $api['channel'],
@@ -125,6 +126,12 @@ class Mattermost extends Transport
'descr' => 'Icon URL',
'type' => 'text',
],
[
'title' => 'Author_name',
'name' => 'mattermost-author_name',
'descr' => 'Optional name used to identify the author',
'type' => 'text',
],
],
'validation' => [
'mattermost-url' => 'required|url',