You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Feature Request: Support useExtracted / getExtracted from next-intl in React Email
#3463
next-intl recently introduced useExtracted / getExtracted (available in next-intl@4.5, currently experimental), which takes a Tailwind-inspired approach to i18n:
No keys: strings are written inline and keys are auto-generated and minified.
No manual catalog management: the catalog is a compile output, not a source of truth.
Colocated messages: translations live next to the component code, not in a separate file.
ICU support and TypeScript validation: same feature parity as useTranslations.
.po file support: optional GNU gettext format for richer translation context (descriptions, file references).
This pattern is increasingly the recommended approach for next-intl in Next.js apps, and email templates authored in that codebase will naturally reach for useExtracted alongside their other components.
Proposal
Update the React Email next-intl integration guide and ensure compatibility with the useExtracted / getExtracted APIs.
Specifically:
Documentation: Add a section (or a separate guide page) covering how to use useExtracted in email templates alongside the existing createTranslator guide, so developers can choose their preferred approach.
getExtracted for async templates: Since React Email templates are rendered server-side (and often as async components), document the use of getExtracted from next-intl/server as the primary path:
import{getExtracted}from'next-intl/server';exportdefaultasyncfunctionWelcomeEmail({ name }){constt=awaitgetExtracted();return(<Html><Preview>{t('Welcome to Acme')}</Preview><Body><Heading>{t('Welcome to Acme')}</Heading><Text>{t('Hi {name}!',{ name })}</Text><Text>{t("Thanks for signing up! We're excited to have you on board.")}</Text><Buttonhref="https://example.com/dashboard">{t('Get Started')}</Button><Text>{t('If you have any questions, reply to this email. We'reheretohelp!')}
</Text></Body></Html>);}
Preview environment compatibility: Clarify how useExtracted / getExtracted behaves in the React Email preview server (notably, next-intl docs state it works out-of-the-box in test environments without compilation). Verify this holds in the React Email dev preview and document any required setup.
Locale configuration: Document how to wire up getRequestConfig (or a simpler standalone config) so that locale resolution works when rendering email templates outside the Next.js request context (e.g. in a background job or API route).
Track stability: Since useExtracted is currently experimental in next-intl, this could initially ship as a "coming soon" or "experimental" section in the docs, with a stable guide once next-intl marks the API stable.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Goals
useExtractedandgetExtractedfromnext-intl@4.5+for inline, keyless i18n.Background
React Email currently supports next-intl via
createTranslator, which requires:messages/en.json,messages/es.json).t('welcome-email.header')).Reference: https://react.email/docs/guides/internationalization/next-intl
next-intl recently introduced
useExtracted/getExtracted(available innext-intl@4.5, currently experimental), which takes a Tailwind-inspired approach to i18n:useTranslations..pofile support: optional GNU gettext format for richer translation context (descriptions, file references).Reference:
This pattern is increasingly the recommended approach for next-intl in Next.js apps, and email templates authored in that codebase will naturally reach for
useExtractedalongside their other components.Proposal
Update the React Email next-intl integration guide and ensure compatibility with the
useExtracted/getExtractedAPIs.Specifically:
Documentation: Add a section (or a separate guide page) covering how to use
useExtractedin email templates alongside the existingcreateTranslatorguide, so developers can choose their preferred approach.getExtractedfor async templates: Since React Email templates are rendered server-side (and often as async components), document the use ofgetExtractedfromnext-intl/serveras the primary path:Preview environment compatibility: Clarify how
useExtracted/getExtractedbehaves in the React Email preview server (notably, next-intl docs state it works out-of-the-box in test environments without compilation). Verify this holds in the React Email dev preview and document any required setup.Locale configuration: Document how to wire up
getRequestConfig(or a simpler standalone config) so that locale resolution works when rendering email templates outside the Next.js request context (e.g. in a background job or API route).Track stability: Since
useExtractedis currently experimental in next-intl, this could initially ship as a "coming soon" or "experimental" section in the docs, with a stable guide once next-intl marks the API stable.All reactions