Skip to content

fix(broadcasts): media-template broadcasts fail at Meta (#131008)#69

Merged
sathyaprakash000 merged 1 commit into
mainfrom
fix/broadcast-media-template
Jun 17, 2026
Merged

fix(broadcasts): media-template broadcasts fail at Meta (#131008)#69
sathyaprakash000 merged 1 commit into
mainfrom
fix/broadcast-media-template

Conversation

@sathyaprakash000

Copy link
Copy Markdown
Contributor

Problem

Broadcasting an approved media-header template (image from the Media Library) fails immediately — status goes Pending → Failed with no message sent — even though Send Test of the same template delivers fine with the image.

Root cause

A media-header template stores its image in message_templates.header_media_library_id.

  • Test-send resolves the header image from that column → works.
  • Broadcast only read broadcast.media_library_id and never fetched the template's own header_media_library_id. The frontend didn't prefill it either, so it was empty → buildTemplateComponents built no header component → Meta rejected with #131008 ("Required parameter is missing").

Fix

  • Backend (routes/broadcasts.js, both /send and /test): fetch t.header_media_library_id and fall back to it (broadcast.media_library_id || template.header_media_library_id) when resolving the header media and stamping template_meta. A template broadcast now resolves the header exactly like a test-send.
  • Frontend (BulkMessagePage.jsx): auto-prefill the media picker with the template's saved header image, so users don't re-select it, the preview renders, and the Send button isn't blocked.

Test

  • node -c on broadcasts.js and esbuild parse on BulkMessagePage.jsx pass.

…roadcasts

A media-header template stores its image in message_templates.header_media_library_id.
The template test-send resolved the header from that column, but the broadcast path
only looked at broadcast.media_library_id and never fetched the template's own image.
When a user broadcast a media-header template, no header component was built and Meta
rejected the send with #131008 (missing required parameter) — Pending then Failed,
even though Send Test worked.

Backend: fetch t.header_media_library_id in the /send and /test SELECTs and fall back
to it (broadcast.media_library_id || template.header_media_library_id) when resolving
the header media and stamping template_meta.

Frontend: auto-prefill the broadcast media picker with the template's saved header
image so users don't re-select it, the preview renders, and Send isn't blocked.

Signed-off-by: sthirumalairajan2212 <92260025+sthirumalairajan2212@users.noreply.github.com>
@sathyaprakash000 sathyaprakash000 merged commit 1c5b0e8 into main Jun 17, 2026
11 checks passed
@sathyaprakash000 sathyaprakash000 deleted the fix/broadcast-media-template branch June 17, 2026 06:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants