From be2761744108a117e5a7fc5f0e29830ebf595d69 Mon Sep 17 00:00:00 2001 From: Rowan Seymour Date: Wed, 3 Jul 2024 19:15:35 +0000 Subject: [PATCH] Update payload for queueing a bradocast --- temba/mailroom/queue.py | 5 ++++- temba/mailroom/tests.py | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/temba/mailroom/queue.py b/temba/mailroom/queue.py index ab80d4db0ae..293eadc4e87 100644 --- a/temba/mailroom/queue.py +++ b/temba/mailroom/queue.py @@ -31,15 +31,18 @@ def queue_broadcast(broadcast): task = { "translations": broadcast.translations, - "template_state": "unevaluated", "base_language": broadcast.base_language, + "expressions": True, "optin_id": broadcast.optin_id, + "template_id": broadcast.template_id, + "template_variables": broadcast.template_variables or [], "urns": broadcast.urns or [], "contact_ids": list(broadcast.contacts.values_list("id", flat=True)), "group_ids": list(broadcast.groups.values_list("id", flat=True)), "broadcast_id": broadcast.id, "org_id": broadcast.org_id, "created_by_id": broadcast.created_by_id, + "template_state": "unevaluated", # deprecated } _queue_batch_task(broadcast.org_id, BatchTask.SEND_BROADCAST, task, HIGH_PRIORITY) diff --git a/temba/mailroom/tests.py b/temba/mailroom/tests.py index aa94064974b..bb902a9b4a0 100644 --- a/temba/mailroom/tests.py +++ b/temba/mailroom/tests.py @@ -42,15 +42,18 @@ def test_queue_broadcast(self): "eng": {"text": "Welcome to mailroom!"}, "spa": {"text": "\u00a1Bienvenidx a mailroom!"}, }, - "template_state": "unevaluated", "base_language": "eng", + "expressions": True, "optin_id": None, + "template_id": None, + "template_variables": [], "urns": ["tel:+12065556666"], "contact_ids": [jim.id], "group_ids": [bobs.id], "broadcast_id": bcast.id, "org_id": self.org.id, "created_by_id": self.admin.id, + "template_state": "unevaluated", # deprecated, }, "queued_on": matchers.ISODate(), },