diff --git a/scripts/seed_uat_data_v2_5_1.py b/scripts/seed_uat_data_v2_5_1.py index cf031ce..bc572f7 100644 --- a/scripts/seed_uat_data_v2_5_1.py +++ b/scripts/seed_uat_data_v2_5_1.py @@ -252,9 +252,27 @@ def main() -> None: ("UAT_INVITE", "ERP Invitation", "Please accept invitation: {{ invite_url }}"), ("UAT_NOTICE", "Notice update", "Notice {{ reference_no }} requires attention"), ]: + template_label = code.replace("_", " ") upsert(email_templates, {"tenant_id": tenant_a_id, "template_code": code}, { - **common_scope, "name": code.replace("_", " "), "subject": subject, "body": body, "body_html": body, - "template_type": "system", "is_active": True, + **common_scope, + # Different ERP builds use different mandatory/template column names. + "name": template_label, + "template_name": template_label, + "title": template_label, + "subject": subject, + "email_subject": subject, + "subject_template": subject, + "template_subject": subject, + "body": body, + "body_text": body, + "body_html": body, + "html_body": body, + "template_body": body, + "content": body, + "template_content": body, + "template_type": "system", + "category": "system", + "is_active": True, }, f"email template {code}") email_queue = find_table("email_queue", "queued_emails", "mail_queue")