Skip to content

Commit c0d07a3

Browse files
authored
Merge pull request #12 from sentdm/release-please--branches--main--changes--next
release: 0.8.0
2 parents e64ce8f + 4728c1c commit c0d07a3

File tree

129 files changed

+12571
-2173
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

129 files changed

+12571
-2173
lines changed

.release-please-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "0.7.0"
2+
".": "0.8.0"
33
}

.stats.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
configured_endpoints: 12
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/sent%2Fsent-dm-a02f66b4c3837ff1b6d38b924856b9afad2b3bfbc3152c1b4dfbe1ee895008a5.yml
3-
openapi_spec_hash: 30e666a2b17c0768213eaa74e0aec11b
4-
config_hash: 804a43c36c8e58c8d0ff2e57dd6545ec
1+
configured_endpoints: 44
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/sent%2Fsent-dm-433bfd8c688a6b6d2d4f964bb59121d692798f4e2bb6cb47f6110c4f0e1f638d.yml
3+
openapi_spec_hash: 5378295d401c8c1152c1946cc7dbd69f
4+
config_hash: 43a0daa5b05d44a1620e3da0ea6f4fdc

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
# Changelog
22

3+
## 0.8.0 (2026-02-18)
4+
5+
Full Changelog: [v0.7.0...v0.8.0](https://github.com/sentdm/sent-dm-python/compare/v0.7.0...v0.8.0)
6+
7+
### Features
8+
9+
* **api:** manual updates ([360738f](https://github.com/sentdm/sent-dm-python/commit/360738fed511bd249fb75d9c1c263c28964a0e15))
10+
* **api:** manual updates ([3635da5](https://github.com/sentdm/sent-dm-python/commit/3635da501ca023b5fe35f55946189a84933a9c54))
11+
* **api:** manual updates ([c839787](https://github.com/sentdm/sent-dm-python/commit/c839787873794ed14357133cdc4eea6b97bbe422))
12+
313
## 0.7.0 (2026-02-16)
414

515
Full Changelog: [v0.6.2...v0.7.0](https://github.com/sentdm/sent-dm-python/compare/v0.6.2...v0.7.0)

README.md

Lines changed: 93 additions & 105 deletions
Original file line numberDiff line numberDiff line change
@@ -30,17 +30,21 @@ from sent_dm import SentDm
3030

3131
client = SentDm(
3232
api_key=os.environ.get("SENT_DM_API_KEY"), # This is the default and can be omitted
33-
sender_id=os.environ.get("SENT_DM_SENDER_ID"), # This is the default and can be omitted
3433
)
3534

36-
client.messages.send_to_phone(
37-
phone_number="+1234567890",
38-
template_id="7ba7b820-9dad-11d1-80b4-00c04fd430c8",
39-
template_variables={
40-
"name": "John Doe",
41-
"order_id": "12345",
35+
response = client.messages.send(
36+
channel=["sms", "whatsapp"],
37+
template={
38+
"id": "7ba7b820-9dad-11d1-80b4-00c04fd430c8",
39+
"name": "order_confirmation",
40+
"parameters": {
41+
"name": "John Doe",
42+
"order_id": "12345",
43+
},
4244
},
45+
to=["+14155551234", "+14155555678"],
4346
)
47+
print(response.data)
4448
```
4549

4650
While you can provide an `api_key` keyword argument,
@@ -59,19 +63,23 @@ from sent_dm import AsyncSentDm
5963

6064
client = AsyncSentDm(
6165
api_key=os.environ.get("SENT_DM_API_KEY"), # This is the default and can be omitted
62-
sender_id=os.environ.get("SENT_DM_SENDER_ID"), # This is the default and can be omitted
6366
)
6467

6568

6669
async def main() -> None:
67-
await client.messages.send_to_phone(
68-
phone_number="+1234567890",
69-
template_id="7ba7b820-9dad-11d1-80b4-00c04fd430c8",
70-
template_variables={
71-
"name": "John Doe",
72-
"order_id": "12345",
70+
response = await client.messages.send(
71+
channel=["sms", "whatsapp"],
72+
template={
73+
"id": "7ba7b820-9dad-11d1-80b4-00c04fd430c8",
74+
"name": "order_confirmation",
75+
"parameters": {
76+
"name": "John Doe",
77+
"order_id": "12345",
78+
},
7379
},
80+
to=["+14155551234", "+14155555678"],
7481
)
82+
print(response.data)
7583

7684

7785
asyncio.run(main())
@@ -102,17 +110,21 @@ from sent_dm import AsyncSentDm
102110
async def main() -> None:
103111
async with AsyncSentDm(
104112
api_key=os.environ.get("SENT_DM_API_KEY"), # This is the default and can be omitted
105-
sender_id=os.environ.get("SENT_DM_SENDER_ID"), # This is the default and can be omitted
106113
http_client=DefaultAioHttpClient(),
107114
) as client:
108-
await client.messages.send_to_phone(
109-
phone_number="+1234567890",
110-
template_id="7ba7b820-9dad-11d1-80b4-00c04fd430c8",
111-
template_variables={
112-
"name": "John Doe",
113-
"order_id": "12345",
115+
response = await client.messages.send(
116+
channel=["sms", "whatsapp"],
117+
template={
118+
"id": "7ba7b820-9dad-11d1-80b4-00c04fd430c8",
119+
"name": "order_confirmation",
120+
"parameters": {
121+
"name": "John Doe",
122+
"order_id": "12345",
123+
},
114124
},
125+
to=["+14155551234", "+14155555678"],
115126
)
127+
print(response.data)
116128

117129

118130
asyncio.run(main())
@@ -136,61 +148,17 @@ from sent_dm import SentDm
136148

137149
client = SentDm()
138150

139-
template_response_v2 = client.templates.create(
140-
definition={
141-
"body": {
142-
"multi_channel": {
143-
"template": "Hello {{1:variable}}, thank you for joining our service. We're excited to help you with your messaging needs!",
144-
"type": None,
145-
"variables": [
146-
{
147-
"id": 1,
148-
"name": "customerName",
149-
"props": {
150-
"alt": None,
151-
"media_type": None,
152-
"sample": "John Doe",
153-
"short_url": None,
154-
"url": None,
155-
"variable_type": "text",
156-
},
157-
"type": "variable",
158-
}
159-
],
160-
},
161-
"sms": {},
162-
"whatsapp": {},
163-
},
164-
"authentication_config": {},
165-
"buttons": [{}],
166-
"definition_version": "1.0",
167-
"footer": {
168-
"template": "Best regards, The SentDM Team",
169-
"type": "text",
170-
"variables": [{}],
171-
},
172-
"header": {
173-
"template": "Welcome to {{1:variable}}!",
174-
"type": "text",
175-
"variables": [
176-
{
177-
"id": 1,
178-
"name": "companyName",
179-
"props": {
180-
"alt": None,
181-
"media_type": None,
182-
"sample": "SentDM",
183-
"short_url": None,
184-
"url": None,
185-
"variable_type": "text",
186-
},
187-
"type": "variable",
188-
}
189-
],
151+
response = client.messages.send(
152+
template={
153+
"id": "7ba7b820-9dad-11d1-80b4-00c04fd430c8",
154+
"name": "order_confirmation",
155+
"parameters": {
156+
"name": "John Doe",
157+
"order_id": "12345",
190158
},
191159
},
192160
)
193-
print(template_response_v2.definition)
161+
print(response.template)
194162
```
195163

196164
## Handling errors
@@ -209,13 +177,17 @@ from sent_dm import SentDm
209177
client = SentDm()
210178

211179
try:
212-
client.messages.send_to_phone(
213-
phone_number="+1234567890",
214-
template_id="7ba7b820-9dad-11d1-80b4-00c04fd430c8",
215-
template_variables={
216-
"name": "John Doe",
217-
"order_id": "12345",
180+
client.messages.send(
181+
channel=["sms"],
182+
template={
183+
"id": "7ba7b820-9dad-11d1-80b4-00c04fd430c8",
184+
"name": "order_confirmation",
185+
"parameters": {
186+
"name": "John Doe",
187+
"order_id": "12345",
188+
},
218189
},
190+
to=["+14155551234"],
219191
)
220192
except sent_dm.APIConnectionError as e:
221193
print("The server could not be reached")
@@ -259,13 +231,17 @@ client = SentDm(
259231
)
260232

261233
# Or, configure per-request:
262-
client.with_options(max_retries=5).messages.send_to_phone(
263-
phone_number="+1234567890",
264-
template_id="7ba7b820-9dad-11d1-80b4-00c04fd430c8",
265-
template_variables={
266-
"name": "John Doe",
267-
"order_id": "12345",
234+
client.with_options(max_retries=5).messages.send(
235+
channel=["sms"],
236+
template={
237+
"id": "7ba7b820-9dad-11d1-80b4-00c04fd430c8",
238+
"name": "order_confirmation",
239+
"parameters": {
240+
"name": "John Doe",
241+
"order_id": "12345",
242+
},
268243
},
244+
to=["+14155551234"],
269245
)
270246
```
271247

@@ -289,13 +265,17 @@ client = SentDm(
289265
)
290266

291267
# Override per-request:
292-
client.with_options(timeout=5.0).messages.send_to_phone(
293-
phone_number="+1234567890",
294-
template_id="7ba7b820-9dad-11d1-80b4-00c04fd430c8",
295-
template_variables={
296-
"name": "John Doe",
297-
"order_id": "12345",
268+
client.with_options(timeout=5.0).messages.send(
269+
channel=["sms"],
270+
template={
271+
"id": "7ba7b820-9dad-11d1-80b4-00c04fd430c8",
272+
"name": "order_confirmation",
273+
"parameters": {
274+
"name": "John Doe",
275+
"order_id": "12345",
276+
},
298277
},
278+
to=["+14155551234"],
299279
)
300280
```
301281

@@ -337,18 +317,22 @@ The "raw" Response object can be accessed by prefixing `.with_raw_response.` to
337317
from sent_dm import SentDm
338318

339319
client = SentDm()
340-
response = client.messages.with_raw_response.send_to_phone(
341-
phone_number="+1234567890",
342-
template_id="7ba7b820-9dad-11d1-80b4-00c04fd430c8",
343-
template_variables={
344-
"name": "John Doe",
345-
"order_id": "12345",
320+
response = client.messages.with_raw_response.send(
321+
channel=["sms"],
322+
template={
323+
"id": "7ba7b820-9dad-11d1-80b4-00c04fd430c8",
324+
"name": "order_confirmation",
325+
"parameters": {
326+
"name": "John Doe",
327+
"order_id": "12345",
328+
},
346329
},
330+
to=["+14155551234"],
347331
)
348332
print(response.headers.get('X-My-Header'))
349333

350-
message = response.parse() # get the object that `messages.send_to_phone()` would have returned
351-
print(message)
334+
message = response.parse() # get the object that `messages.send()` would have returned
335+
print(message.data)
352336
```
353337

354338
These methods return an [`APIResponse`](https://github.com/sentdm/sent-dm-python/tree/main/src/sent_dm/_response.py) object.
@@ -362,13 +346,17 @@ The above interface eagerly reads the full response body when you make the reque
362346
To stream the response body, use `.with_streaming_response` instead, which requires a context manager and only reads the response body once you call `.read()`, `.text()`, `.json()`, `.iter_bytes()`, `.iter_text()`, `.iter_lines()` or `.parse()`. In the async client, these are async methods.
363347

364348
```python
365-
with client.messages.with_streaming_response.send_to_phone(
366-
phone_number="+1234567890",
367-
template_id="7ba7b820-9dad-11d1-80b4-00c04fd430c8",
368-
template_variables={
369-
"name": "John Doe",
370-
"order_id": "12345",
349+
with client.messages.with_streaming_response.send(
350+
channel=["sms"],
351+
template={
352+
"id": "7ba7b820-9dad-11d1-80b4-00c04fd430c8",
353+
"name": "order_confirmation",
354+
"parameters": {
355+
"name": "John Doe",
356+
"order_id": "12345",
357+
},
371358
},
359+
to=["+14155551234"],
372360
) as response:
373361
print(response.headers.get("X-My-Header"))
374362

0 commit comments

Comments
 (0)