mirror of
https://github.com/node-red/node-red-nodes.git
synced 2025-03-01 10:37:43 +00:00
add option to set criteria witch type of emails should be requested (#519)
This commit is contained in:
committed by
Dave Conway-Jones
parent
31b9cc1f61
commit
aa684240d8
@@ -160,6 +160,7 @@ module.exports = function(RED) {
|
||||
this.useSSL= n.useSSL;
|
||||
this.protocol = n.protocol || "IMAP";
|
||||
this.disposition = n.disposition || "None"; // "None", "Delete", "Read"
|
||||
this.criteria = n.criteria || "UNSEEN"; // "ALL", "ANSWERED", "FLAGGED", "SEEN", "UNANSWERED", "UNFLAGGED", "UNSEEN"
|
||||
|
||||
var flag = false;
|
||||
|
||||
@@ -343,7 +344,7 @@ module.exports = function(RED) {
|
||||
return;
|
||||
}
|
||||
else {
|
||||
imap.search([ 'UNSEEN' ], function(err, results) {
|
||||
imap.search([ this.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