mirror of
https://github.com/node-red/node-red-nodes.git
synced 2023-10-10 13:36:58 +02: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:
parent
877763aae9
commit
16130362fc
@ -182,6 +182,7 @@
|
|||||||
<option value="UNANSWERED" data-i18n="email.label.unanswered"></option>
|
<option value="UNANSWERED" data-i18n="email.label.unanswered"></option>
|
||||||
<option value="UNFLAGGED" data-i18n="email.label.unflagged"></option>
|
<option value="UNFLAGGED" data-i18n="email.label.unflagged"></option>
|
||||||
<option value="UNSEEN" selected="selected" data-i18n="email.label.unseen"></option>
|
<option value="UNSEEN" selected="selected" data-i18n="email.label.unseen"></option>
|
||||||
|
<option value="_msg_" data-i18n="email.label.criteriaFromMsg"></option>
|
||||||
<!--
|
<!--
|
||||||
<option value="DELETED" data-i18n="email.label.delete"></option>
|
<option value="DELETED" data-i18n="email.label.delete"></option>
|
||||||
<option value="DRAFT" data-i18n="email.label.none"></option>
|
<option value="DRAFT" data-i18n="email.label.none"></option>
|
||||||
|
@ -352,7 +352,10 @@ module.exports = function(RED) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else {
|
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) {
|
if (err) {
|
||||||
node.status({fill:"red", shape:"ring", text:"email.status.foldererror"});
|
node.status({fill:"red", shape:"ring", text:"email.status.foldererror"});
|
||||||
node.error(RED._("email.errors.fetchfail", {folder:node.box}),err);
|
node.error(RED._("email.errors.fetchfail", {folder:node.box}),err);
|
||||||
|
@ -22,6 +22,7 @@
|
|||||||
"read": "Mark Read",
|
"read": "Mark Read",
|
||||||
"delete": "Delete",
|
"delete": "Delete",
|
||||||
"criteria": "Criteria",
|
"criteria": "Criteria",
|
||||||
|
"criteriaFromMsg": "- set from msg.criteria -",
|
||||||
"all": "All",
|
"all": "All",
|
||||||
"answered": "Answered",
|
"answered": "Answered",
|
||||||
"flagged": "Flagged",
|
"flagged": "Flagged",
|
||||||
|
@ -15,7 +15,8 @@
|
|||||||
"disposition": "受信後の処理",
|
"disposition": "受信後の処理",
|
||||||
"none": "なし",
|
"none": "なし",
|
||||||
"read": "既読",
|
"read": "既読",
|
||||||
"delete": "削除"
|
"delete": "削除",
|
||||||
|
"criteriaFromMsg": "- msg.criteriaから使用 -"
|
||||||
},
|
},
|
||||||
"default-message": "__description__\n\nNode-REDからファイルが添付されました: __filename__",
|
"default-message": "__description__\n\nNode-REDからファイルが添付されました: __filename__",
|
||||||
"tip": {
|
"tip": {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "node-red-node-email",
|
"name": "node-red-node-email",
|
||||||
"version": "1.5.2",
|
"version": "1.6.0",
|
||||||
"description": "Node-RED nodes to send and receive simple emails",
|
"description": "Node-RED nodes to send and receive simple emails",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"imap": "^0.8.19",
|
"imap": "^0.8.19",
|
||||||
|
Loading…
Reference in New Issue
Block a user