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
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
34b5d19064
commit
685d33c4fe
@ -81,16 +81,10 @@ def _fix_template_parameters():
|
|||||||
).first()
|
).first()
|
||||||
|
|
||||||
if template:
|
if template:
|
||||||
# Correct body parameters to match what send_wedding_invitation_bulk sends
|
# Correct body parameters to match the template structure:
|
||||||
correct_params = [
|
# - Body has 1 placeholder {{1}} = contact_name
|
||||||
"contact_name",
|
# - Button has 1 placeholder {{1}} = event_id (handled separately via button_param_key)
|
||||||
"groom_name",
|
correct_params = ["contact_name"]
|
||||||
"bride_name",
|
|
||||||
"venue",
|
|
||||||
"event_date",
|
|
||||||
"event_time",
|
|
||||||
"guest_link"
|
|
||||||
]
|
|
||||||
|
|
||||||
current_params = json.loads(template.body_params or "[]")
|
current_params = json.loads(template.body_params or "[]")
|
||||||
if current_params != correct_params:
|
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"
|
"message": "hina_invitation template not found in database"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Correct body parameters to match what send_wedding_invitation_bulk sends
|
# Correct body parameters to match the template structure:
|
||||||
correct_params = [
|
# - Body has 1 placeholder {{1}} = contact_name
|
||||||
"contact_name",
|
# - Button has 1 placeholder {{1}} = event_id (handled separately via button_param_key)
|
||||||
"groom_name",
|
correct_params = ["contact_name"]
|
||||||
"bride_name",
|
|
||||||
"venue",
|
|
||||||
"event_date",
|
|
||||||
"event_time",
|
|
||||||
"guest_link"
|
|
||||||
]
|
|
||||||
|
|
||||||
old_params = template.body_params
|
old_params = template.body_params
|
||||||
template.body_params = json.dumps(correct_params)
|
template.body_params = json.dumps(correct_params)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user