Add hina_invitation to built-in templates with NO body parameters (static body) and fix test endpoint
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
This commit is contained in:
parent
eba57bd81a
commit
df8970f101
@ -81,9 +81,9 @@ def _fix_template_parameters():
|
||||
|
||||
if template:
|
||||
# Expected correct parameters for hina_invitation
|
||||
# Body {{1}} = contact_name (guest's name)
|
||||
# Button {{1}} = event_id (sent as separate button parameter)
|
||||
expected_params = ["contact_name"]
|
||||
# hina_invitation has NO body parameters (body is static in Meta)
|
||||
# Only has button parameter: event_id
|
||||
expected_params = []
|
||||
|
||||
try:
|
||||
current_params = json.loads(template.body_params)
|
||||
@ -2001,13 +2001,12 @@ async def test_whatsapp_send(
|
||||
|
||||
service = get_whatsapp_service(db)
|
||||
|
||||
# Send with minimal parameters - just for testing
|
||||
# hina_invitation template has no body parameters - only button parameter
|
||||
params = {
|
||||
"contact_name": "Test",
|
||||
"event_id": "test-event-123"
|
||||
}
|
||||
|
||||
# Use hina_invitation template (only requires contact_name and event_id)
|
||||
# Use hina_invitation template (static body, dynamic button URL)
|
||||
template_key = "hina_invitation"
|
||||
|
||||
result = await service.send_by_template_key(
|
||||
|
||||
@ -240,6 +240,26 @@ TEMPLATES: Dict[str, Dict[str, Any]] = {
|
||||
"guest_link": "https://invy.dvirlabs.com/guest",
|
||||
},
|
||||
},
|
||||
|
||||
# ── hina_invitation ────────────────────────────────────────────────────────
|
||||
# Special event template with static body text and dynamic button URL
|
||||
# No body parameters - body text is defined in Meta template
|
||||
# Button {{1}} = event_id (dynamic URL parameter)
|
||||
"hina_invitation": {
|
||||
"meta_name": "hina_invitation",
|
||||
"language_code": "he",
|
||||
"friendly_name": "הזמנה לחינה",
|
||||
"description": "הזמנה לאירוע חינה עם קישור דינמי",
|
||||
"header_params": [],
|
||||
"body_params": [],
|
||||
"button_type": "URL",
|
||||
"button_text": "הצבע על הזמנה",
|
||||
"button_url": "https://invy.dvirlabs.com/guest/{{1}}",
|
||||
"button_param_key": "event_id",
|
||||
"fallbacks": {
|
||||
"event_id": "event-id",
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user