habulaj commited on
Commit
31ac193
·
verified ·
1 Parent(s): 0ce4ab9

Update routes/sendnotifications.py

Browse files
Files changed (1) hide show
  1. routes/sendnotifications.py +7 -2
routes/sendnotifications.py CHANGED
@@ -139,8 +139,8 @@ async def send_notification(
139
  ):
140
  sender_id = await verify_user_token(user_token)
141
 
142
- if data.keyword not in ("follow", "like", "subscriber", "newmessage"):
143
- raise HTTPException(status_code=400, detail="Unsupported keyword")
144
 
145
  # Determine target_user_id
146
  if data.keyword == "like":
@@ -212,6 +212,11 @@ async def send_notification(
212
  body = f"{actor_name} liked your post" + (f": \"{desc}\"" if desc else ".")
213
  image_url = post_info["image_url"]
214
 
 
 
 
 
 
215
  elif data.keyword == "subscriber":
216
  title = "💼 New Subscriber!"
217
  body = f"{actor_name} just subscribed to your styling services."
 
139
  ):
140
  sender_id = await verify_user_token(user_token)
141
 
142
+ if data.keyword not in ("follow", "like", "subscriber", "newmessage", "changeprice"):
143
+ raise HTTPException(status_code=400, detail="Unsupported keyword")
144
 
145
  # Determine target_user_id
146
  if data.keyword == "like":
 
212
  body = f"{actor_name} liked your post" + (f": \"{desc}\"" if desc else ".")
213
  image_url = post_info["image_url"]
214
 
215
+ elif data.keyword == "changeprice":
216
+ title = "⚠️ Subscription Price Changed"
217
+ # u.name está no actor_name (abreviado)
218
+ body = f"{actor_name} changed your subscription price. Your subscription was automatically canceled. Please check the chat with {actor_name} for reactivation options and more info."
219
+
220
  elif data.keyword == "subscriber":
221
  title = "💼 New Subscriber!"
222
  body = f"{actor_name} just subscribed to your styling services."