[CCSDK-28] populated the seed code for dgbuilder
[ccsdk/distribution.git] / dgbuilder / core_nodes / social / 61-email.html
1 <!--
2   Copyright 2013,2014 IBM Corp.
3
4   Licensed under the Apache License, Version 2.0 (the "License");
5   you may not use this file except in compliance with the License.
6   You may obtain a copy of the License at
7
8   http://www.apache.org/licenses/LICENSE-2.0
9
10   Unless required by applicable law or agreed to in writing, software
11   distributed under the License is distributed on an "AS IS" BASIS,
12   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   See the License for the specific language governing permissions and
14   limitations under the License.
15 -->
16
17 <script type="text/x-red" data-template-name="e-mail">
18     <div class="form-row">
19         <label for="node-input-name"><i class="fa fa-envelope"></i> To</label>
20         <input type="text" id="node-input-name" placeholder="email@address.com">
21     </div>
22     <!-- <div class="form-row">
23         <label for="node-input-pin"><i class="fa fa-asterisk"></i> Service</label>
24         <select type="text" id="node-input-pin" style="width: 150px;">
25             <option value="-" disabled> </option>
26             <option value="DynectEmail">DynectEmail</option>
27             <option value="Gmail">Gmail</option>
28             <option value="hot.ee">hot.ee</option>
29             <option value="Hotmail">Hotmail</option>
30             <option value="iCloud">iCloud</option>
31             <option value="mail.ee">mail.ee</option>
32             <option value="Mail.Ru">Mail.Ru</option>
33             <option value="Mailgun">Mailgun</option>
34             <option value="Mailjet">Mailjet</option>
35             <option value="Mandrill">Mandrill</option>
36             <option value="Postmark">Postmark</option>
37             <option value="QQ">QQ</option>
38             <option value="QQex">QQex</option>
39             <option value="SendGrid">SendGrid</option>
40             <option value="SendCloud">SendCloud</option>
41             <option value="SES">SES</option>
42             <option value="Yahoo">Yahoo</option>
43             <option value="yandex">yandex</option>
44             <option value="Zoho">Zoho</option>
45          </select>
46     </div> -->
47     <div class="form-row">
48         <label for="node-input-server"><i class="fa fa-globe"></i> Server</label>
49         <input type="text" id="node-input-server" placeholder="smtp.gmail.com">
50     </div>
51     <div class="form-row">
52         <label for="node-input-port"><i class="fa fa-random"></i> Port</label>
53         <input type="text" id="node-input-port" placeholder="465">
54     </div>
55     <div class="form-row">
56         <label for="node-input-userid"><i class="fa fa-user"></i> Userid</label>
57         <input type="text" id="node-input-userid">
58     </div>
59     <div class="form-row">
60         <label for="node-input-password"><i class="fa fa-lock"></i> Password</label>
61         <input type="password" id="node-input-password">
62     </div>
63     <br/>
64     <div class="form-row">
65         <label for="node-input-dname"><i class="fa fa-tag"></i> Name</label>
66         <input type="text" id="node-input-dname" placeholder="Name">
67     </div>
68     <div class="form-tips" id="node-tip"><b>Note:</b> Copied credentials from global emailkeys.js file.</div>
69 </script>
70
71 <script type="text/x-red" data-help-name="e-mail">
72     <p>Sends the <b>msg.payload</b> as an email, with a subject of <b>msg.topic</b>.</p>
73     <!-- <p>It sends the message to the configured recipient <i>only</i>.</p> -->
74     <p>You may dynamically overide the default recipient by setting a <b>msg.to</b> property.</p>
75     <!-- <p><b>msg.topic</b> is used to set the subject of the email, and <b>msg.payload</b> is the body text.</p> -->
76 </script>
77
78 <script type="text/javascript">
79 (function() {
80     RED.nodes.registerType('e-mail',{
81         category: 'social-output',
82         color:"#c7e9c0",
83         defaults: {
84             server: {value:"smtp.gmail.com",required:true},
85             port: {value:"465",required:true},
86             name: {value:"",required:true},
87             dname: {value:""}
88         },
89         credentials: {
90             userid: {type:"text"},
91             password: {type: "password"},
92             global: { type:"boolean"}
93         },
94
95         inputs:1,
96         outputs:0,
97         icon: "envelope.png",
98         align: "right",
99         label: function() {
100             return this.dname||this.name||"email";
101         },
102         labelStyle: function() {
103             return (this.dname||!this.topic)?"node_label_italic":"";
104         },
105         oneditprepare: function() {
106             if (this.credentials.global) {
107                 $('#node-tip').show();
108             } else {
109                 $('#node-tip').hide();
110             };
111         }
112     });
113 })();
114 </script>
115
116
117 <script type="text/x-red" data-template-name="e-mail in">
118     <div class="form-row node-input-repeat">
119         <label for="node-input-repeat"><i class="fa fa-repeat"></i> Check Repeat (S)</label>
120         <input type="text" id="node-input-repeat" placeholder="300">
121     </div>
122     <div class="form-row">
123         <label for="node-input-server"><i class="fa fa-globe"></i> Server</label>
124         <input type="text" id="node-input-server" placeholder="imap.gmail.com">
125     </div>
126     <div class="form-row">
127         <label for="node-input-port"><i class="fa fa-random"></i> Port</label>
128         <input type="text" id="node-input-port" placeholder="993">
129     </div>
130     <div class="form-row">
131         <label for="node-input-userid"><i class="fa fa-user"></i> Userid</label>
132         <input type="text" id="node-input-userid">
133     </div>
134     <div class="form-row">
135         <label for="node-config-input-password"><i class="fa fa-lock"></i> Password</label>
136         <input type="password" id="node-input-password">
137     </div>
138     <br/>
139     <div class="form-row">
140         <label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
141         <input type="text" id="node-input-name" placeholder="Name">
142     </div>
143     <div class="form-tips" id="node-tip"><b>Note:</b> Copied credentials from global emailkeys.js file.</div>
144     <div id="node-input-tip" class="form-tips">Tip: <b>ONLY</b> retrieves the single most recent email.</div>
145 </script>
146
147 <script type="text/x-red" data-help-name="e-mail in">
148     <p>Repeatedly gets a <b>single email</b> from an IMAP server and forwards on as a msg if not already seen.</p>
149     <p>The subject is loaded into <b>msg.topic</b> and <b>msg.payload</b> is the plain text body.
150        If there is text/html then that is returned in <b>msg.html</b>. <b>msg.from</b> and <b>msg.date</b> are also set if you need them.</p>
151     <p>Uses the imap module.</p>
152     <p><b>Note:</b> this node <i>only</i> gets the most recent single email from the inbox, so set the repeat (polling) time appropriately.</p>
153 </script>
154
155 <script type="text/javascript">
156 (function() {
157     RED.nodes.registerType('e-mail in',{
158         category: 'social-input',
159         color:"#c7e9c0",
160         defaults: {
161             repeat: {value:"300",required:true},
162             server: {value:"imap.gmail.com",required:true},
163             port: {value:"993",required:true},
164             name: {value:""}
165         },
166         credentials: {
167             userid: {type:"text"},
168             password: {type: "password"},
169             global: { type:"boolean"}
170         },
171         inputs:0,
172         outputs:1,
173         icon: "envelope.png",
174         label: function() {
175             return this.name||"email";
176         },
177         labelStyle: function() {
178             return (this.name||!this.topic)?"node_label_italic":"";
179         },
180         oneditprepare: function() {
181             if (this.credentials.global) {
182                 $('#node-tip').show();
183             } else {
184                 $('#node-tip').hide();
185             };
186         }
187     });
188 })();
189 </script>