Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Aug 14, 2025. It is now read-only.

Commit 300b2f3

Browse files
authored
Merge pull request #162 from notificationapi-com/7kYU2CPd/3080-fix-quick-start-guide-for-python-to-match-the-reference-section-in-docs
Update quick start
2 parents f07954c + c3ead2c commit 300b2f3

File tree

1 file changed

+19
-17
lines changed

1 file changed

+19
-17
lines changed

docs/quick-start/send-a-notification.md

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -227,29 +227,31 @@ notificationapi.send({
227227

228228
```py
229229
# import
230+
import asyncio
230231
from notificationapi_python_server_sdk import (notificationapi)
231232

232233
# init
233234
notificationapi.init("CLIENT_ID", "CLIENT_SECRET")
234235

235236
# send
236-
notificationapi.send({
237-
#The ID of the notification you wish to send. You can find this
238-
#value from the dashboard.
239-
"notificationId": "order_tracking",
240-
241-
# The user to send the notification to.
242-
"user": {
243-
"id": "spongebob.squarepants",
244-
"email": "[email protected]", # required for email notifications
245-
},
246-
# mergeTags is to pass dynamic values into the notification design.
247-
"mergeTags": {
248-
"item": "Krabby Patty Burger",
249-
"address": "124 Conch Street",
250-
"orderId": "1234567890"
251-
}
252-
})
237+
async def send_notification():
238+
await notificationapi.send(
239+
{
240+
"notificationId": "order_tracking",
241+
"user": {
242+
"id": "spongebob.squarepants",
243+
"email": "[email protected]"
244+
},
245+
"mergeTags": {
246+
"item": "Krabby Patty Burger",
247+
"address": "124 Conch Street",
248+
"orderId": "1234567890"
249+
}
250+
}
251+
)
252+
253+
# Run the async function
254+
asyncio.run(send_notification())
253255
```
254256

255257
</TabItem>

0 commit comments

Comments
 (0)