UNPKG

node-red-contrib-blynk-ws

Version:

Node Red integration with Blynk App and Server through websockets

65 lines (58 loc) 2.42 kB
<script type="text/javascript"> // eslint-disable-next-line func-names (function () { function onEditPrepare() { } function onEditSave() { } function label() { return this.name || this.email || 'email'; } RED.nodes.registerType('blynk-ws-out-email', { category: 'Blynk_ws', paletteLabel: 'email', defaults: { name: { value: '' }, email: { value: '', required: true, validate: RED.validators.regex(/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/) }, // eslint-disable-line max-len, no-useless-escape client: { type: 'blynk-ws-client', required: true }, }, color: '#1BC17C', inputs: 1, outputs: 0, icon: 'email.png', align: 'right', labelStyle() { return this.name ? 'node_label_italic' : ''; }, label, oneditsave: onEditSave, oneditprepare: onEditPrepare, }); }()); </script> <!-- Blynk out Node - Email --> <script type="text/x-red" data-template-name="blynk-ws-out-email"> <div class="form-row" id="websocket-client-row"> <label for="node-input-client"><i class="fa fa-bookmark"></i> <span>Connection</span></label> <input type="text" id="node-input-client"> </div> <div class="form-row"> <label for="node-input-email"><i class="fa fa-envelope-o"></i> <span>Email</span></label> <input type="text" id="node-input-email" placeholder="Email address"> </div> <div class="form-row"> <label for="node-input-name"><i class="fa fa-tag"></i> <span>Name</span></label> <input type="text" id="node-input-name" data-i18n="[placeholder]node-red:common.label.name"> </div> </script> <script type="text/x-red" data-help-name="blynk-ws-out-email"> <p>Blynk email node.</p> <p>This node will send an email using your <code>msg.topic</code> for subject and <code>msg.payload</code> for content. <br /> Remember to add the email widget in your project and that the Blynk server has a setting how many emails per minute to send. </p> <p class="form-tips"> Official documentation: <a href="https://gablau.dev/blynk-legacy-docs/#widgets-notifications-email">Email</a> <p> </script>