forked from travisghansen/node-red-slack
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathslackpost.html
More file actions
74 lines (64 loc) · 2.88 KB
/
slackpost.html
File metadata and controls
74 lines (64 loc) · 2.88 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
<!--
Copyright 2015 Adrian Lansdown
Not created by, affiliated with, or supported by Slack Technologies, Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<script type="text/x-red" data-template-name="slack">
<div class="form-row">
<label for="node-input-channelURL"><i class="fa fa-slack"></i> WebHook URL</label>
<input type="text" id="node-input-channelURL" placeholder="channelURL" style=" vertical-align: top;">
</div>
<div class="form-row">
<label for="node-input-username"><i class="fa fa-user"></i> Posting UserName</label>
<input type="text" id="node-input-username" placeholder="username" style=" vertical-align: top;">
</div>
<div class="form-row">
<label for="node-input-emojiIcon"><i class="fa fa-smile-o"></i> Emoji Icon</label>
<input type="text" id="node-input-emojiIcon" placeholder=":emojiIcon:" style=" vertical-align: top;">
</div>
<div class="form-row">
<label for="node-input-channel"><i class="fa fa-random"></i> Channel</label>
<input type="text" id="node-input-channel" placeholder="optional channel override">
</div>
<div class="form-row">
<label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
<input type="text" id="node-input-name" placeholder="Name">
</div>
</script>
<script type="text/x-red" data-help-name="slack">
<p>Sends the <b>msg.payload</b> to Slack.</p>
<p>Simple way to post to a Slack channel.</p>
<p>You can optionally override the destination channel if required - either in the edit dialogue or by setting <b>msg.channel</b>.</p>
<p>You can also create <a href="https://api.slack.com/docs/attachments" target="_new">Slack attachments</a> by adding a <b>msg.attachments</b> property that must be an array.</p>
</script>
<script type="text/javascript">
RED.nodes.registerType('slack',{
category: 'social',
defaults: {
name: {value:""},
channelURL: {value:"", required:true},
username: {value:""},
emojiIcon: {value:""},
channel: {value:""}
},
color:"#4C9689",
icon: "hash.png",
align: "right",
inputs:1,
outputs:0,
label: function() {
return this.name||"slack";
},
labelStyle: function() {
return this.name?"node_label_italic":"";
}
});
</script>