sendbyte 0.2.1__tar.gz → 0.3.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: sendbyte
3
- Version: 0.2.1
3
+ Version: 0.3.0
4
4
  Summary: SendByte Python SDK: the email API for Africa.
5
5
  Author: Echospectra Technology Limited
6
6
  License: MIT
@@ -85,6 +85,7 @@ asyncio.run(main())
85
85
  sendbyte.emails.send(from_=..., to=..., subject=..., html=...)
86
86
  sendbyte.emails.get("em_123")
87
87
  sendbyte.emails.list(limit=20, status="delivered")
88
+ sendbyte.emails.conversation("em_123")
88
89
  ```
89
90
 
90
91
  `to`, `cc`, `bcc`, and `reply_to` accept a single address or a list. Pass `idempotency_key` to make retries safe, `scheduled_at` for future sends, and `template_id` with `variables` to render a server side template.
@@ -112,6 +113,38 @@ sendbyte.webhooks.disable(endpoint["id"])
112
113
  sendbyte.webhooks.replay("evt_123")
113
114
  ```
114
115
 
116
+ ### Receiving email
117
+
118
+ Receive mail on a subdomain of a verified domain, read it, and reply in the same thread. Received emails count toward your monthly email quota, the same as sent emails; `enable()` acknowledges that for you. Spam and virus emails never count.
119
+
120
+ ```python
121
+ sendbyte.receiving.enable()
122
+ setup = sendbyte.receiving.enable_domain("dom_123", subdomain="inbound")
123
+ # publish setup["mx_record"], then confirm it is live
124
+ sendbyte.receiving.check_domain("dom_123")
125
+
126
+ page = sendbyte.received.list(status="received,delivered", limit=20)
127
+ email = sendbyte.received.get(page["data"][0]["id"])
128
+ print(email["from"], email["subject"], email["text"])
129
+
130
+ sendbyte.received.reply(email["id"], text="Thanks, we are on it.")
131
+ ```
132
+
133
+ Routes decide what happens to mail arriving at matching addresses: send it to your webhooks, forward it, or drop it.
134
+
135
+ ```python
136
+ sendbyte.inbound_routes.create(
137
+ "exact",
138
+ domain_id="dom_123",
139
+ match_value="support",
140
+ action="forward",
141
+ forward_to=["team@paylink.ng"],
142
+ )
143
+ sendbyte.inbound_routes.list("dom_123")
144
+ ```
145
+
146
+ Subscribe a webhook to `email.received` to get the whole email, bodies included, as it arrives. On the async client the same methods are awaitable under `sendbyte.receiving`, `sendbyte.received` and `sendbyte.inbound_routes`. See the [receiving guide](https://docs.sendbyte.africa/guides/receiving).
147
+
115
148
  ## Verifying webhook signatures
116
149
 
117
150
  Every webhook request carries a `sendbyte-signature` header. Verify it against the raw request body before trusting the payload.
@@ -64,6 +64,7 @@ asyncio.run(main())
64
64
  sendbyte.emails.send(from_=..., to=..., subject=..., html=...)
65
65
  sendbyte.emails.get("em_123")
66
66
  sendbyte.emails.list(limit=20, status="delivered")
67
+ sendbyte.emails.conversation("em_123")
67
68
  ```
68
69
 
69
70
  `to`, `cc`, `bcc`, and `reply_to` accept a single address or a list. Pass `idempotency_key` to make retries safe, `scheduled_at` for future sends, and `template_id` with `variables` to render a server side template.
@@ -91,6 +92,38 @@ sendbyte.webhooks.disable(endpoint["id"])
91
92
  sendbyte.webhooks.replay("evt_123")
92
93
  ```
93
94
 
95
+ ### Receiving email
96
+
97
+ Receive mail on a subdomain of a verified domain, read it, and reply in the same thread. Received emails count toward your monthly email quota, the same as sent emails; `enable()` acknowledges that for you. Spam and virus emails never count.
98
+
99
+ ```python
100
+ sendbyte.receiving.enable()
101
+ setup = sendbyte.receiving.enable_domain("dom_123", subdomain="inbound")
102
+ # publish setup["mx_record"], then confirm it is live
103
+ sendbyte.receiving.check_domain("dom_123")
104
+
105
+ page = sendbyte.received.list(status="received,delivered", limit=20)
106
+ email = sendbyte.received.get(page["data"][0]["id"])
107
+ print(email["from"], email["subject"], email["text"])
108
+
109
+ sendbyte.received.reply(email["id"], text="Thanks, we are on it.")
110
+ ```
111
+
112
+ Routes decide what happens to mail arriving at matching addresses: send it to your webhooks, forward it, or drop it.
113
+
114
+ ```python
115
+ sendbyte.inbound_routes.create(
116
+ "exact",
117
+ domain_id="dom_123",
118
+ match_value="support",
119
+ action="forward",
120
+ forward_to=["team@paylink.ng"],
121
+ )
122
+ sendbyte.inbound_routes.list("dom_123")
123
+ ```
124
+
125
+ Subscribe a webhook to `email.received` to get the whole email, bodies included, as it arrives. On the async client the same methods are awaitable under `sendbyte.receiving`, `sendbyte.received` and `sendbyte.inbound_routes`. See the [receiving guide](https://docs.sendbyte.africa/guides/receiving).
126
+
94
127
  ## Verifying webhook signatures
95
128
 
96
129
  Every webhook request carries a `sendbyte-signature` header. Verify it against the raw request body before trusting the payload.
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "sendbyte"
7
- version = "0.2.1"
7
+ version = "0.3.0"
8
8
  description = "SendByte Python SDK: the email API for Africa."
9
9
  readme = "README.md"
10
10
  license = { text = "MIT" }