- Initial Predicate contains either 'all' or 'any'
- 'all' indicates that all the given conditions must match in order to run the actions.
- 'any' indicates that at least one of the conditions must match in order to run the conditions.
ruleshave a list of sub_rules.- Each sub_rule is a dictionary with three "key": "value" pair
- Fields include
from,to,subject,message,labelsanddate - Predicates for
dateareafterandbefore - Predicates for other fields include
contains,does_not_contain,equal_to, andnot_equal_to - Value for
dateis in the format%Y/%m/%d - Value for other fields is a string
"rules": [
{
"field":"date",
"predicate": "before",
"value":"2018/10/03"
},
{
"field":"message",
"predicate": "does_not_contain",
"value":"Test"
}
]
actionshas a list of actions that will occur on the order of declaration- Actions include
mark_read,mark_unread,add_label,delete,starred,archive_messageandrestore_message###Example
"actions":["mark_read","starred", "restore_message"]
Refer rule.json for sample