Update routes/sendnotifications.py
Browse files
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 |
-
|
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."
|