You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+77-17Lines changed: 77 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,29 +3,47 @@
3
3
4
4
# Matterhook.NET.MatterhookClient
5
5
6
-
Matterhook.NET.MatterhookClient is a simple webhook client to post messages to your Mattermost server using Webhooks.
6
+
Matterhook.NET.MatterhookClient is a simple webhook client to post messages to your Mattermost server using Webhooks. It supports message buttons and menus (menus are only supported in Mattermost v5.4+).
7
7
8
-
## Usage
8
+
## Installation
9
9
10
-
You can install the package from nuget using `Install-Package Matterhook.NET.MatterhookClient`,
10
+
You can install the latest release by installing the package from NuGet using `Install-Package Matterhook.NET.MatterhookClient`.
11
11
12
12
Alternatively, clone/fork this repo and compile the source yourself.
13
13
14
-
### Simple Message:
15
-
16
-
```C#
14
+
## Basic usage
17
15
16
+
Using this library is really easy. Just create a new MatterhookClient
@@ -135,8 +147,8 @@ var message = new MattermostMessage()
135
147
}
136
148
}
137
149
};
138
-
Task.WaitAll(client.PostAsync(message));
139
150
```
151
+
140
152

141
153
142
154
Clicking `Merge` will trigger a POST request to `https://matterhook.example.com/merge` with following body
@@ -160,4 +172,52 @@ and clicking `Notify` will trigger a POST request to `https://matterhook.example
160
172
"text": "New code was pushed."
161
173
}
162
174
}
163
-
```
175
+
```
176
+
177
+
### Message with menu buttons (supported in Mattermost 5.4+)
178
+
179
+
You also can post messages with menu buttons. It will post a message with a dropdown button where the users can select a value, which will be posted to the target integration.
180
+
181
+
Just add an attachment to your message as follows:
182
+
183
+
```csharp
184
+
Attachments=newList<MattermostAttachment>
185
+
{
186
+
newMattermostAttachment
187
+
{
188
+
Pretext="This is optional pretext that shows above the attachment.",
0 commit comments