app/services/message_builder.py:88:def validate_html(html: str) -> List[str]: 18:from app.services.message_builder import html_to_pdf, sanitize_preview, validate_html 131: problems = validate_html(html_body) 136: problems = [p for p in problems if not p.startswith("Unsubstituted variables")] 137: if problems: # validate_html returns a list of problem strings 139: detail=f"HTML rejected: {'; '.join(problems)}") 200: problems = validate_html(res.text) 201: if problems: # list of problem strings 203: detail=f"Template has errors: {'; '.join(problems)}")