diff --git a/README.md b/README.md index 8cdc79d3..c58b719d 100644 --- a/README.md +++ b/README.md @@ -109,6 +109,10 @@ for thread in namespace.threads.where(starred=True): # List all threads with 'ben@nylas.com' for thread in namespace.threads.where(any_email='ben@nylas.com').items(): print thread.subject + +# List threads in order of most recently received message (excludes sent messages) +for thread in namespace.threads.where(sort='received_recent_date'): + print thread.subject ``` diff --git a/nylas/client/restful_models.py b/nylas/client/restful_models.py index 7a6e7362..a45e1feb 100644 --- a/nylas/client/restful_models.py +++ b/nylas/client/restful_models.py @@ -213,6 +213,7 @@ def messages(self): class Thread(NylasAPIObject): attrs = ["draft_ids", "id", "message_ids", "namespace_id", "object", "participants", "snippet", "subject", "subject_date", "tags", + "last_message_timestamp", "first_message_timestamp", "unread", "starred", "version", "_folders", "_labels"] collection_name = 'threads'