You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+5-1Lines changed: 5 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,9 @@
1
1
# Changelog
2
2
3
+
## [2.1]
4
+
### Added
5
+
- Add support for sending [transactional push messages](https://customer.io/docs/transactional-api/#transactional-push-notifications) ([#95](https://github.com/customerio/customerio-python/pull/95))
6
+
3
7
## [2.0]
4
8
### Changed
5
9
- Updated transactional email request optional argument `amp_body` to `body_amp` for consistency across APIs ([#93](https://github.com/customerio/customerio-python/pull/93))
@@ -34,4 +38,4 @@
34
38
35
39
### Changed
36
40
- ID fields in request path are url escaped
37
-
- Sanitize event data ([#32](https://github.com/customerio/customerio-python/pull/32))
41
+
- Sanitize event data ([#32](https://github.com/customerio/customerio-python/pull/32))
Copy file name to clipboardExpand all lines: README.md
+36-1Lines changed: 36 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -188,8 +188,11 @@ See REST documentation [here](https://learn.customer.io/api/#apisuppress_delete)
188
188
189
189
### Send Transactional Messages
190
190
191
-
To use the [Transactional API](https://customer.io/docs/transactional-api), instantiate the Customer.io object using an [app key](https://customer.io/docs/managing-credentials#app-api-keys) and create a request object containing:
191
+
To use the [Transactional API](https://customer.io/docs/transactional-api), instantiate the Customer.io object using an [app key](https://customer.io/docs/managing-credentials#app-api-keys) and create a request object for your message type.
192
192
193
+
## Email
194
+
195
+
SendEmailRequest requires:
193
196
*`transactional_message_id`: the ID of the transactional message you want to send, or the `body`, `from`, and `subject` of a new message.
194
197
*`to`: the email address of your recipients
195
198
* an `identifiers` object containing the `id` of your recipient. If the `id` does not exist, Customer.io will create it.
*`transactional_message_id`: the ID of the transactional push message you want to send.
236
+
* an `identifiers` object containing the `id` or `email` of your recipient. If the profile does not exist, Customer.io will create it.
237
+
238
+
Use `send_push` referencing your request to send a transactional message. [Learn more about transactional messages and `SendPushRequest` properties](https://customer.io/docs/transactional-api).
239
+
240
+
```python
241
+
from customerio import APIClient, Regions, SendPushRequest
242
+
client = APIClient("your API key", region=Regions.US)
243
+
244
+
request = SendPushRequest(
245
+
transactional_message_id="3",
246
+
message_data={
247
+
"name": "person",
248
+
"items": [
249
+
{
250
+
"name": "shoes",
251
+
"price": "59.99",
252
+
},
253
+
]
254
+
},
255
+
identifiers={
256
+
"id": "2",
257
+
}
258
+
)
259
+
260
+
response = client.send_push(request)
261
+
print(response)
262
+
```
263
+
229
264
## Notes
230
265
- The Customer.io Python SDK depends on the [`Requests`](https://pypi.org/project/requests/) library which includes [`urllib3`](https://pypi.org/project/urllib3/) as a transitive dependency. The [`Requests`](https://pypi.org/project/requests/) library leverages connection pooling defined in [`urllib3`](https://pypi.org/project/urllib3/). [`urllib3`](https://pypi.org/project/urllib3/) only attempts to retry invocations of `HTTP` methods which are understood to be idempotent (See: [`Retry.DEFAULT_ALLOWED_METHODS`](https://github.com/urllib3/urllib3/blob/main/src/urllib3/util/retry.py#L184)). Since the `POST` method is not considered to be idempotent, any invocations which require `POST` are not retried.
0 commit comments