1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00
node-red/nodes/core/social/61-email.html

52 lines
2.0 KiB
HTML

<!--
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>
<p>Uses the nodemailer module - you also need to pre-configure your email SMTP settings in a file emailkeys.js like that below.</p>
<p><pre>module.exports = { service: "Gmail", user: "blahblah@gmail.com", pass: "password", server: "imap.gmail.com", port: "993" }</pre></p>
<p>This <b>must</b> be located in the diectory above node-red.</p>
</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>