-
Notifications
You must be signed in to change notification settings - Fork 5
/
docs.json
16 lines (16 loc) · 964 Bytes
/
docs.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
{
"example": [
{
"votes": "0",
"title": "Mark emails with more than 10 recipients as low priority",
"description": "This rule can help with marking emails in mass newsletters as low priority. ",
"code": "# include any code of the example \ndef on_message(msg): \n if len(msg.to + msg.cc + msg.bcc) > 10:\n message.add_flags([\"low\"])"
},
{
"votes": "0",
"title": "Mark emails with more than 10 recipients and last three messages from sender are unread as low priority",
"description": "This rule can help with marking emails in mass newletters as low priority while filtering out those emails which you actually want to read.",
"code": "# include any code of the example def on_message(msg): \n sender = message.from\n prev_msgs = sender.recent_messages(3)\n if all([not prev_msg.is_read for prev_msg in prev_msgs]):\n if len(msg.to + msg.cc + msg.bcc) > 10:\n msg.add_flags([\"low\"])"
}
]
}