Skip to content

feat(template): add shared WhatsApp/Twilio message-template utilities#62

Open
devi-r wants to merge 6 commits into
mainfrom
feat/whatsapp-template-utils
Open

feat(template): add shared WhatsApp/Twilio message-template utilities#62
devi-r wants to merge 6 commits into
mainfrom
feat/whatsapp-template-utils

Conversation

@devi-r

@devi-r devi-r commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Move the message-template logic (filtering, normalizing, validation, preview rendering and send-payload building) into the shared package so both web and mobile can consume a single implementation. Adds extractFilenameFromUrl to url.ts.

Move the message-template logic (filtering, normalizing, validation,
preview rendering and send-payload building) into the shared package so
both web and mobile can consume a single implementation. Adds
extractFilenameFromUrl to url.ts.
@github-actions

Copy link
Copy Markdown

size-limit report 📦

Path Size
dist/utils.cjs.production.min.js 13.84 KB (+16.23% 🔺)
dist/utils.esm.js 13.2 KB (+15.32% 🔺)

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a87213f7dc

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/template.ts Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3adb35fa17

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/template.ts Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3a3d8e7871

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/template.ts Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: fb01553e25

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/template.ts Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 347cd5fdb8

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/template.ts
Comment on lines +209 to +213
if (hasVariables && processedParams.body) {
const hasEmptyBodyVariable = Object.keys(processedParams.body).some(
key => !processedParams.body?.[key]
);
if (hasEmptyBodyVariable) return false;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Validate required body variables from the template

When callers pass an existing or partial processed_params object instead of the exact scaffold from buildWhatsAppProcessedParams, this checks only the body keys that are already present. For a template like Hi {{1}} {{2}}, { body: { '1': 'Sam' } } has no empty provided keys and is treated as complete, so the composer can send the template without the required {{2}} value; validate against the variables extracted from the template body instead.

Useful? React with 👍 / 👎.

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.

1 participant