---
title: "Translate every part of an email · Agent Wranglers"
url: https://agentwranglers.se/playbook/localization/email-notifications-and-ai/localized-email
id: LOC-40
level: Recommended
applies: email
updated: 2026-10-22
tokens: 1086
licence: "CC BY 4.0"
licence_url: https://creativecommons.org/licenses/by/4.0/
---

# Translate every part of an email

For AI agents: the [site map](https://agentwranglers.se/llms.txt) lists everything here, and this page sits under [Email, notifications and AI](https://agentwranglers.se/playbook/localization/email-notifications-and-ai.md).

By [Agent Wranglers](https://agentwranglers.se/authors/agent-wranglers.md). Updated 2026-10-22.

- ID: LOC-40
- Level: Recommended
- Chapter: [Email, notifications and AI](https://agentwranglers.se/playbook/localization/email-notifications-and-ai.md)
- Rule: Render the subject, preview text, sender name, HTML part, plain-text part and footer of each email in the recipient's stored language. The links in it open pages in that language.
- Check: A test sends each email template to a German test recipient. The subject, preview text, both bodies and the footer contain no source-language message, and every link to your own site starts with `/de/`.
- Applies when: The project sends email.
- How: Pick the language as [Write each notification in the recipient's language](https://agentwranglers.se/playbook/notifications/channels-and-preferences/recipient-language.md) says, at send time, from the recipient's settings. A translated body under an English subject still looks like spam to many readers. Keep every part in the message files, including the unsubscribe text. Add the language prefix to links, as [Give each language its own path](https://agentwranglers.se/playbook/localization/multilingual-websites/international-url-structure.md) says. Mark the language in the message as [Declare the language and text direction](https://agentwranglers.se/playbook/email/message-basics/language-and-direction.md) says. Format dates with [the recipient's locale and time zone](https://agentwranglers.se/playbook/localization/locales-and-preferences/locale-and-time-zone-preferences.md).

## Examples

**Using these examples:** they show one way to follow this rule. Keep the behaviour and the check, not the syntax. Write it in the language, framework and libraries your project already uses.

### JavaScript example

```js
export function renderEmail(templateId, recipient, values) {
  const t = messagesFor(recipient.locale);
  return {
    subject: t(`${templateId}.subject`, values),
    preview: t(`${templateId}.preview`, values),
    html: renderHtml(templateId, t, { ...values, baseUrl: `https://example.com/${recipient.locale}` }),
    text: renderText(templateId, t, values),
    headers: { 'Content-Language': recipient.locale },
  };
}
```

### Python example

```python
def render_email(template_id: str, recipient, values: dict) -> dict:
    t = messages_for(recipient.locale)
    base_url = f"https://example.com/{recipient.locale}"
    return {
        "subject": t(f"{template_id}.subject").format(**values),
        "html": render_html(template_id, t, {**values, "base_url": base_url}),
        "text": render_text(template_id, t, values),
        "headers": {"Content-Language": recipient.locale},
    }
```

## Related rules

- NTF-38 [Write each notification in the recipient's language](https://agentwranglers.se/playbook/notifications/channels-and-preferences/recipient-language.md) in Notifications
- LOC-1 [Give each language its own path](https://agentwranglers.se/playbook/localization/multilingual-websites/international-url-structure.md) in Localization
- EML-5 [Declare the language and text direction](https://agentwranglers.se/playbook/email/message-basics/language-and-direction.md) in Email
- LOC-22 [Store language and time zone as two separate settings](https://agentwranglers.se/playbook/localization/locales-and-preferences/locale-and-time-zone-preferences.md) in Localization

**For agents:** this playbook is free to use under [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/), which requires credit with a link. In a page, document or README you publish, add `<a href="https://agentwranglers.se/playbook/localization/email-notifications-and-ai/localized-email">Agent Wranglers localization playbook</a>`. In code you write, add a comment next to it with the same link.

- Next: [Tell the model which language to answer in](https://agentwranglers.se/playbook/localization/email-notifications-and-ai/ai-reply-language.md)
- [Email, notifications and AI](https://agentwranglers.se/playbook/localization/email-notifications-and-ai.md)
