Files
Ben GotowandClaude Opus 5 1f4a9a7656 Add subject line support to email templates (#2794)
* Make subject lines part of templates and autofill them

Templates only covered the message body, so anyone using them for
outreach had to retype the subject line by hand every time - the most
repetitive part of sending the same email over and over.

A template can now carry a subject, stored in a `<meta name="subject">`
tag at the top of its HTML file so each template stays a single,
hand-editable file. Templates without the tag parse to an empty subject
and behave exactly as before.

- Preferences > Templates gains a Subject field next to the name.
- "Save Draft as Template" stores the draft's subject, not just its body.
- Inserting a template fills the draft's subject when it is empty, and
  asks before replacing a subject the user already typed. The subject of
  a reply is never touched.
- The template picker shows each template's subject under its name and
  matches it while searching.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01S6tHJb3ZDFgeE5YQHC5xTo

* Leave forward subjects alone and match template names by substring

Two fixes from PR review:

- Forwards carry a `Fwd:` prefix and the original subject in the same way
  replies carry `Re:`, but they use `forwardedHeaderMessageId`, so they
  fell through the reply guard and could have their subject replaced.
  Skip them too, and cover the case in the specs.
- The template picker matched names by prefix but subjects by substring,
  so searching "up" found a template whose subject was "Following up" but
  not one named "Follow up". Match both lines the same way.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01S6tHJb3ZDFgeE5YQHC5xTo

* Don't save a reply or forward subject onto a new template

"Save Draft as Template" stored whatever was in the draft's subject
field, so templating a reply or a forward baked "Re: …" / "Fwd: …" into
the template and every later use of it would try to apply that. Apply
the same reply/forward rule the insert path already uses, so a subject
is only saved when it isn't tied to a thread. The draft's subject still
names the template either way.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01S6tHJb3ZDFgeE5YQHC5xTo

* Reuse the existing replace-contents dialog copy

The three-way message split added two new translatable strings for a
distinction the user doesn't need to act on - either way they're
choosing whether to let the template overwrite the draft. Go back to
the single already-translated string for every case.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01S6tHJb3ZDFgeE5YQHC5xTo

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-08-23 13:26:40 -05:00
..