Skip to content

Export EmailLanguage and document the email lang field (brew-v2#2225) - #81

Merged
thedogwiththedataonit merged 1 commit into
mainfrom
claude/email-lang
Oct 24, 2026
Merged

thedogwiththedataonit merged 1 commit into
mainfrom
claude/email-lang

Conversation

@thedogwiththedataonit

@thedogwiththedataonit thedogwiththedataonit commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Follow-up to GetBrew/brew-v2#2225 (merged and deployed 10-23), which added emails.lang: the language of an email's copy, as an ISO 639-1 code or zh-Hans / zh-Hant. Companion PRs: GetBrew/brew-cli#70 and GetBrew/docs#350.

The spec mirror and generated types already carry lang on main (released in 13.3.0). This PR adds what generation doesn't:

  • EmailLanguage type, exported from the package root. It is derived from the generated EmailDetail['lang'], so a language the API adds arrives with the next type sync and there is no list to keep in step by hand.
  • Tests:
    • emails.edit forwards an envelope-only lang, and lang: null (which clears a language the caller named so Brew reads it again).
    • emails.get returns lang, typed as EmailLanguage, with a @ts-expect-error for a code outside the enum.
  • docs/emails.md: lang on the detail row, GenerateEmailInput and EditEmailInput, including null clearing.
  • JSDoc and CHANGELOG (Unreleased).

Checks

  • tsc --noEmit, eslint ., prettier --check . and tsup pass.
  • vitest run: 764/764 passing, on main at 4f25ad2.

Production check (10-25): get_email returns lang: "en" on a September design, list rows omit lang, and the HTML download starts with <html lang="en" dir="ltr">.

🤖 Generated with Claude Code

RetriggerView in GreptileConfidence Score: 5/5

The PR appears safe to merge after the related API change is deployed.

Summary

Exposes EmailLanguage from the SDK's existing generated API types and documents how callers set or clear an email's language.

  • Email callers can set, clear, and read the copy language.

Reviews (2) · Last reviewed commit: "Document the email lang field and export..." · Reviewed by Greptile

The generated types already carry `lang` (13.3.0). This adds the
EmailLanguage type derived from the API enum, tests for lang and
lang: null on emails.edit and lang on emails.get, and the emails docs
and changelog entry.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@thedogwiththedataonit thedogwiththedataonit changed the title Add the email lang field (brew-v2#2225) Export EmailLanguage and document the email lang field (brew-v2#2225) Oct 24, 2026
@thedogwiththedataonit
thedogwiththedataonit merged commit f79921c into main Oct 24, 2026
3 checks passed
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