@@ -38,8 +38,8 @@ activitysmith = ActivitySmith(
3838``` python
3939response = activitysmith.notifications.send(
4040 {
41- " title" : " Build Failed " ,
42- " message" : " CI pipeline failed on main branch " ,
41+ " title" : " New subscription 💸 " ,
42+ " message" : " Customer upgraded to Pro plan " ,
4343 " channels" : [" devs" , " ops" ], # Optional
4444 }
4545)
@@ -54,9 +54,9 @@ print(response.devices_notified)
5454start = activitysmith.live_activities.start(
5555 {
5656 " content_state" : {
57- " title" : " ActivitySmith API Deployment " ,
58- " subtitle" : " start " ,
59- " number_of_steps" : 4 ,
57+ " title" : " Nightly database backup " ,
58+ " subtitle" : " create snapshot " ,
59+ " number_of_steps" : 3 ,
6060 " current_step" : 1 ,
6161 " type" : " segmented_progress" ,
6262 " color" : " yellow" ,
@@ -75,9 +75,9 @@ update = activitysmith.live_activities.update(
7575 {
7676 " activity_id" : activity_id,
7777 " content_state" : {
78- " title" : " ActivitySmith API Deployment " ,
79- " subtitle" : " npm i & pm2 " ,
80- " current_step" : 3 ,
78+ " title" : " Nightly database backup " ,
79+ " subtitle" : " upload archive " ,
80+ " current_step" : 2 ,
8181 }
8282 }
8383)
@@ -92,10 +92,10 @@ end = activitysmith.live_activities.end(
9292 {
9393 " activity_id" : activity_id,
9494 " content_state" : {
95- " title" : " ActivitySmith API Deployment " ,
96- " subtitle" : " done " ,
97- " current_step" : 4 ,
98- " auto_dismiss_minutes" : 3 ,
95+ " title" : " Nightly database backup " ,
96+ " subtitle" : " verify restore " ,
97+ " current_step" : 3 ,
98+ " auto_dismiss_minutes" : 2 ,
9999 }
100100 }
101101)
@@ -109,7 +109,7 @@ print(end.success)
109109try :
110110 activitysmith.notifications.send(
111111 {
112- " title" : " Build Failed " ,
112+ " title" : " New subscription 💸 " ,
113113 }
114114 )
115115except Exception as err:
0 commit comments