-
Notifications
You must be signed in to change notification settings - Fork 0
/
whatsapp.html
57 lines (55 loc) · 1.74 KB
/
whatsapp.html
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
<script type="text/html" data-template-name="whatsapp">
<div class="form-row">
<label for="node-input-name">Name</label>
<input type="text" id="node-input-name" placeholder="Name">
</div>
</script>
<script type="text/html" data-help-name="whatsapp">
<p>
<b>About</b>
<br/>
<span>This node use for authenticate and send whatsapp message using node-red</span>
</p>
<p>
<strong>Authentication</strong>
<br/>
<span>You need to provide "connect" as a topic in function or inject node.</span>
<br/><br/>
<code>
msg.topic = "connect"
</code><br/>
<span>This will return a picture with base64 format. You can see it by adding picture node.</span>
</p>
<p>
<strong>Sending Message</strong>
<br/>
<span>You need to provide "send" as a topic, phone number and your message in function or inject node.</span>
<br/><br/>
<code>
msg.topic = "send"<br/>
msg.to = "phone number example: 601247900"<br/>
msg.message = "This is whatsapp message from node-red"<br/>
</code>
<span>This will return success or error information.</span>
</p>
</script>
<script type="text/javascript">
RED.nodes.registerType('whatsapp', {
category: 'WA Service',
color: '#C7E9C0',
defaults: {
name: {
value: ""
}
},
inputs: 1,
outputs: 2,
outputLabels: ["image/base64", "info/text"],
icon: "font-awesome/fa-envelope",
paletteLabel: 'whatsapp',
align: 'left',
label: function () {
return this.name || "whatsapp";
}
});
</script>