#13424: feat(whatsapp): add Newsletter/Channel JID support
stale
size: XS
Cluster:
WhatsApp Enhancements and Fixes
## Summary
Adds support for WhatsApp Newsletter/Channel JIDs (`xxxxx@newsletter`) in the message tool's target validation. Currently, the `normalizeWhatsAppTarget()` function rejects any JID containing `@` that isn't a group JID (`@g.us`) or user JID (`@s.whatsapp.net` / `@lid`), which prevents sending messages to WhatsApp Channels.
## Changes
### `src/whatsapp/normalize.ts`
- Added `isWhatsAppNewsletterJid()` helper that matches `\d+@newsletter` format
- Newsletter JIDs are now passed through `normalizeWhatsAppTarget()` instead of being rejected
### `src/channels/plugins/outbound/whatsapp.ts`
- Newsletter JIDs are treated like group JIDs in outbound routing (bypass `allowFrom` checks, since channels are owned/administered by the sender)
## How it works
The underlying Baileys library already supports `sendMessage()` to `@newsletter` JIDs — the `toWhatsappJid()` utility in `src/utils.ts` correctly passes through any JID containing `@`. This PR only removes the validation barrier in the normalize/outbound layer that prevented newsletter targets from reaching the send path.
## Use case
WhatsApp Channels (launched 2023) are one-way broadcast channels. Bot accounts that are admins/owners of a channel should be able to post to it via the message tool using the newsletter JID as target (e.g. `120363xxx@newsletter`).
Closes #13417
<!-- greptile_comment -->
<h2>Greptile Overview</h2>
<h3>Greptile Summary</h3>
This PR adds WhatsApp Newsletter/Channel JID (`\d+@newsletter`) support by relaxing `normalizeWhatsAppTarget()` validation and allowing outbound routing to bypass `allowFrom` checks for newsletter targets (treated similarly to group JIDs).
Key behavior changes:
- `src/whatsapp/normalize.ts` introduces `isWhatsAppNewsletterJid()` and returns newsletter JIDs unchanged from `normalizeWhatsAppTarget()`.
- `src/channels/plugins/outbound/whatsapp.ts` now treats newsletter JIDs like group JIDs in `resolveTarget()`.
Main follow-up needed before merge: other parts of the outbound pipeline (session routing/metadata) still classify newsletter targets as direct chats, which likely causes inconsistent session keys and chatType compared to the adapter’s intended behavior.
<h3>Confidence Score: 3/5</h3>
- This PR is close but has a routing inconsistency that should be fixed before merge.
- Normalization and outbound adapter logic accept newsletter JIDs, but outbound session routing still treats them as direct chats, which can change session keys/metadata and lead to inconsistent behavior across the pipeline.
- src/infra/outbound/outbound-session.ts
<!-- greptile_other_comments_section -->
<sub>(2/5) Greptile learns from your feedback when you react with thumbs up/down!</sub>
<!-- /greptile_comment -->
Most Similar PRs
#7287: feat(whatsapp): expose group admin functions
by balthazar-bot · 2026-02-02
79.3%
#13431: feat(whatsapp): add built-in Markdown to WhatsApp format transform
by asklee-klawd · 2026-02-10
78.0%
#10196: fix(whatsapp): sanitize raw mention IDs in outbound messages
by koala73 · 2026-02-06
76.9%
#11611: feat: separate group-level allowlist from sender-level command auth...
by thisnick · 2026-02-08
76.4%
#8705: feat(whatsapp): add viewOnce support for ephemeral media
by ndohuu · 2026-02-04
75.9%
#4390: fix(whatsapp): allow media from allowlisted groups without groupAllow…
by Sarang19114 · 2026-01-30
75.9%
#23579: feat(whatsapp): add sender attribution to inbound message logs
by svan058 · 2026-02-22
75.4%
#5665: fix: match group JIDs in groupAllowFrom allowlist
by koala73 · 2026-01-31
74.7%
#20190: WhatsApp: normalize BR 9th-digit outbound targets
by saurabhchopade · 2026-02-18
74.7%
#8224: feat(whatsapp): extract @mentions into dedicated module
by zurizuriaria · 2026-02-03
74.6%