2013-09-05 16:02:48 +02:00
|
|
|
<!--
|
|
|
|
Copyright 2013 IBM Corp.
|
|
|
|
|
|
|
|
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="email">
|
|
|
|
<div class="form-row">
|
|
|
|
<label for="node-input-name"><i class="icon-envelope"></i> To</label>
|
|
|
|
<input type="text" id="node-input-name" placeholder="email@address.com">
|
|
|
|
</div>
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<script type="text/x-red" data-help-name="email">
|
|
|
|
<p>Sends the <b>msg.payload</b> as an email, with a subject of <b>msg.topic</b>.</p>
|
|
|
|
<p>It sends the message to the configured recipient <i>only</i>.</p>
|
|
|
|
<p><b>msg.topic</b> is used to set the subject of the email, and <b>msg.payload</b> is the body text.</p>
|
2013-11-15 09:59:55 +01:00
|
|
|
<p>Uses the nodemailer module - you also need to pre-configure your email SMTP settings in a file emailkeys.js like that below.</p>
|
2013-09-05 16:02:48 +02:00
|
|
|
<p><pre>module.exports = { service: "Gmail", user: "blahblah@gmail.com", pass: "password", server: "imap.gmail.com", port: "993" }</pre></p>
|
2013-11-15 09:59:55 +01:00
|
|
|
<p>This <b>must</b> be located in the diectory above node-red.</p>
|
2013-09-05 16:02:48 +02:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<script type="text/javascript">
|
|
|
|
RED.nodes.registerType('email',{
|
|
|
|
category: 'social-output',
|
|
|
|
color:"#c7e9c0",
|
|
|
|
defaults: {
|
|
|
|
name: {value:"",required:true}
|
|
|
|
},
|
|
|
|
inputs:1,
|
|
|
|
outputs:0,
|
|
|
|
icon: "envelope.png",
|
|
|
|
align: "right",
|
|
|
|
label: function() {
|
|
|
|
return this.name;
|
|
|
|
},
|
|
|
|
labelStyle: function() {
|
|
|
|
return (this.name||!this.topic)?"node_label_italic":"";
|
|
|
|
}
|
|
|
|
});
|
|
|
|
</script>
|