packages/opal-node-email/emailprocess.js
function processNewMessage(msg, mailMessage) {
                // msg = JSON.parse(JSON.stringify(msg)); // Clone the message
                // Populate the msg fields from the content of the email message
                // that we have just parsed.
                msg.payload = mailMessage.text;
                msg.topic = mailMessage.subject;
                msg.date = mailMessage.date;
                msg.header = mailMessage.headers;
                if (mailMessage.html) {
                    msg.html = mailMessage.html;
                }
                if (mailMessage.to && mailMessage.from.to > 0) {
                    msg.to = mailMessage.to;
                }
                if (mailMessage.cc && mailMessage.from.cc > 0) {
                    msg.cc = mailMessage.cc;
                }
                if (mailMessage.bcc && mailMessage.from.bcc > 0) {
                    msg.bcc = mailMessage.bcc;
                }
                if (mailMessage.from && mailMessage.from.length > 0) {
                    msg.from = mailMessage.from[0].address;
                }
                if (mailMessage.attachments) {
                    msg.attachments = mailMessage.attachments;
                } else {
                    msg.attachments = [];
                }
                n.send(msg); // Propagate the message down the flow
            }
function processNewMessage(msg, mailMessage) {
                // msg = JSON.parse(JSON.stringify(msg)); // Clone the message
                // Populate the msg fields from the content of the email message
                // that we have just parsed.
                msg.payload = mailMessage.text;
                msg.topic = mailMessage.subject;
                msg.date = mailMessage.date;
                msg.header = mailMessage.headers;
                if (mailMessage.html) {
                    msg.html = mailMessage.html;
                }
                if (mailMessage.to && mailMessage.from.to > 0) {
                    msg.to = mailMessage.to;
                }
                if (mailMessage.cc && mailMessage.from.cc > 0) {
                    msg.cc = mailMessage.cc;
                }
                if (mailMessage.bcc && mailMessage.from.bcc > 0) {
                    msg.bcc = mailMessage.bcc;
                }
                if (mailMessage.from && mailMessage.from.length > 0) {
                    msg.from = mailMessage.from[0].address;
                }
                if (mailMessage.attachments) {
                    msg.attachments = mailMessage.attachments;
                } else {
                    msg.attachments = [];
                }
                n.send(msg); // Propagate the message down the flow
            }
function processNewMessage ( msg , mailMessage ) { // msg = JSON.parse(JSON.stringify(msg)); // Clone the message // Populate the msg fields from the content of the email message // that we have just parsed. msg . payload = mailMessage . text ; msg . topic = mailMessage . subject ; msg . date = mailMessage . date ; msg . header = mailMessage . headers ; if ( mailMessage . html ) { msg . html = mailMessage . html ; } if ( mailMessage . to && mailMessage . from . to > 0 ) { msg . to = mailMessage . to ; } if ( mailMessage . cc && mailMessage . from . cc > 0 ) { msg . cc = mailMessage . cc ; } if ( mailMessage . bcc && mailMessage . from . bcc > 0 ) { msg . bcc = mailMessage . bcc ; } if ( mailMessage . from && mailMessage . from . length > 0 ) { msg . from = mailMessage . from [ 0 ] . address ; } if ( mailMessage . attachments ) { msg . attachments = mailMessage . attachments ; } else { msg . attachments = [ ] ; } n . send ( msg ) ; // Propagate the message down the flow }
Process a new email message by building a Node-RED message to be passed onwards in the message flow.  The parameter called `msg` is the template message we start with while `mailMessage` is an object returned from `mailparser` that will be used to populate the email. 
Process a new email message by building a Node-RED message to be passed onwards
in the message flow.  The parameter called `msg` is the template message we
start with while `mailMessage` is an object returned from `mailparser` that
will be used to populate the email.

@param {any} msg __DOCSPLACEHOLDER__
@param {any} mailMessage __DOCSPLACEHOLDER__
Process a new email message by building a Node - RED message to be passed onwards in the message flow . The parameter called msg is the template message we start with while mailMessage is an object returned from mailparser that will be used to populate the email . Process a new email message by building a Node - RED message to be passed onwards in the message flow . The parameter called msg is the template message we start with while mailMessage is an object returned from mailparser that will be used to populate the email .