From 685d33c4fe6b952122547face47c922b32223b41 Mon Sep 17 00:00:00 2001 From: dvirlabs <114520947+dvirlabs@users.noreply.github.com> Date: Thu, 14 May 2026 18:36:52 +0300 Subject: [PATCH] Fix hina_invitation template: body should have only 1 parameter (contact_name for {{1}} in body text), button parameter (event_id for {{1}} in URL) is handled separately via button_param_key --- backend/main.py | 28 ++++++++-------------------- 1 file changed, 8 insertions(+), 20 deletions(-) diff --git a/backend/main.py b/backend/main.py index e8564ce..3dda3f2 100644 --- a/backend/main.py +++ b/backend/main.py @@ -81,16 +81,10 @@ def _fix_template_parameters(): ).first() if template: - # Correct body parameters to match what send_wedding_invitation_bulk sends - correct_params = [ - "contact_name", - "groom_name", - "bride_name", - "venue", - "event_date", - "event_time", - "guest_link" - ] + # Correct body parameters to match the template structure: + # - Body has 1 placeholder {{1}} = contact_name + # - Button has 1 placeholder {{1}} = event_id (handled separately via button_param_key) + correct_params = ["contact_name"] current_params = json.loads(template.body_params or "[]") if current_params != correct_params: @@ -2056,16 +2050,10 @@ async def fix_templates(db: Session = Depends(get_db)): "message": "hina_invitation template not found in database" } - # Correct body parameters to match what send_wedding_invitation_bulk sends - correct_params = [ - "contact_name", - "groom_name", - "bride_name", - "venue", - "event_date", - "event_time", - "guest_link" - ] + # Correct body parameters to match the template structure: + # - Body has 1 placeholder {{1}} = contact_name + # - Button has 1 placeholder {{1}} = event_id (handled separately via button_param_key) + correct_params = ["contact_name"] old_params = template.body_params template.body_params = json.dumps(correct_params)