mirror of
https://github.com/node-red/node-red-nodes.git
synced 2025-03-01 10:37:43 +00:00
email optionally uses criteria from message (#547)
* email optionally uses criteria from message Allows for generation of detailed queries through flows when triggering an email fetch in IMAP. * use the same default as a new email node When the criteria is set from a message, if there is no criteria use the same default as a new node.
This commit is contained in:
committed by
Dave Conway-Jones
parent
877763aae9
commit
16130362fc
@@ -352,7 +352,10 @@ module.exports = function(RED) {
|
||||
return;
|
||||
}
|
||||
else {
|
||||
imap.search([ node.criteria ], function(err, results) {
|
||||
var criteria = ((node.criteria === '_msg_')?
|
||||
(msg.criteria || ["UNSEEN"]):
|
||||
([node.criteria]));
|
||||
imap.search(criteria, function(err, results) {
|
||||
if (err) {
|
||||
node.status({fill:"red", shape:"ring", text:"email.status.foldererror"});
|
||||
node.error(RED._("email.errors.fetchfail", {folder:node.box}),err);
|
||||
|
Reference in New Issue
Block a user