Skip to content

Commit 3972249

Browse files
committed
docs: Expand subscription documentation after #1244
1 parent 6a8289a commit 3972249

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

docs/index.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1926,8 +1926,21 @@ for change_type, item in a.inbox.sync_items():
19261926
# a.inbox.item_sync_state.
19271927
```
19281928

1929+
EWS allows subscribing to changes in a mailbox. There are three types of subscriptions; pull,
1930+
push and streaming. For each type, you can subscribe to all folders at once, to a single
1931+
folder, or to a collection of folders (see description of `FolderCollection` above). In the
1932+
following, we show only examples for subscriptions on `Account.inbox`, but the others are
1933+
also possible.
1934+
19291935
Here's how to create a pull subscription that can be used to pull events from the server:
19301936
```python
1937+
# Subscribe to all folders
1938+
subscription_id, watermark = a.subscribe_to_pull()
1939+
1940+
# Subscribe to a collection of folders
1941+
subscription_id, watermark = a.inbox.glob("foo*").subscribe_to_pull()
1942+
1943+
# Subscribe to one folder
19311944
subscription_id, watermark = a.inbox.subscribe_to_pull()
19321945
```
19331946

0 commit comments

Comments
 (0)