mirror of
https://github.com/bitbaum/heidi.git
synced 2026-12-05 03:48:06 +01:00
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019MDtmtfseicWGK2CMC2U5r
23 lines
1.2 KiB
TypeScript
23 lines
1.2 KiB
TypeScript
import type { Draft } from "../admin/actions.ts";
|
|
import type { StoredOrgRequest } from "../orgs/request.ts";
|
|
import { REPLY_DRAFT, wordsLocale } from "../../i18n/dictionaries/operator.ts";
|
|
|
|
/**
|
|
* A reply to a pilot request, written and waiting.
|
|
*
|
|
* FROM A TEMPLATE, NOT A MODEL. It costs nothing, it is there the moment the
|
|
* request is, and every sentence in it is something the product does today:
|
|
* a link the team opens on their own phones, situations chosen for the
|
|
* house, a certificate per finished situation. No price and no promise the
|
|
* owner has not made; they add those. The field it lands in has the
|
|
* microphone and «improve» for anybody who wants it reworded.
|
|
*
|
|
* In the language the request came in: German for a German page, English
|
|
* otherwise. Organisations are addressed formally.
|
|
*/
|
|
export function replyDraft(request: Pick<StoredOrgRequest, "name" | "organisation" | "people" | "locale" | "email">, from: string): Draft {
|
|
const t = REPLY_DRAFT[wordsLocale(request.locale)];
|
|
const team = request.people ? t.team(request.people) : "";
|
|
return { kind: "mail", to: request.email, subject: t.subject(request.organisation), body: t.lines(request.name, request.organisation, team, from).join("\n") };
|
|
}
|