{"success":true,"name":"brimind-solobro-branded-email","description":"About to send any email to a client or prospect — a first contact, a relance, a devis, a correction. Use to send it through the BRIMIND brand template so links, addresses and phone numbers are clickable and the mail looks like the invoices the client sees next. Triggers on every client email, and whenever one arrives looking like unstyled plain text.","category":"unitary","path":"unitary/brimind-solobro-branded-email/SKILL.md","file":"SKILL.md","content":"---\nname: brimind-solobro-branded-email\ndescription: About to send any email to a client or prospect — a first contact, a relance, a devis, a correction. Use to send it through the BRIMIND brand template so links, addresses and phone numbers are clickable and the mail looks like the invoices the client sees next. Triggers on every client email, and whenever one arrives looking like unstyled plain text.\n---\n> Imported from [PRIVATE_HOST] `~/unitary/agents/skills/brimind-solobro-branded-email`. Paths are relative to `[PRIVATE_HOST]:[PATH]`; run commands there via `ssh [PRIVATE_HOST] 'cd ~/unitary && ...'`. Owner send rules from skill i7-remote-ops still apply.\n\n\n# Send the branded mail, not the raw text\n\n`mailflow` already owns a finished BRIMIND email template — navy masthead, brand\nrule, tinted reading panel, footer. It also does three things by itself that a\nhand-written mail never does:\n\n- a bare URL becomes a real **link** (in plain text it is not clickable on a\n  phone, so the one action the mail asks for needs a copy-paste);\n- an email address becomes a **mailto:**;\n- a phone number written in prose becomes a **wa.me link** — every number we\n  print is a WhatsApp account, so the reader taps it and the conversation opens.\n\n## The rule that makes it work — and the trap\n\n`renderEmail()` applies the template **only when the content is plain text**\n(`isPlainText()`). Hand it HTML and it assumes the caller has already designed\nthe mail and passes it straight through.\n\nThat is exactly how every client email went out unstyled until 2026-09-04:\n`agents/reply.mjs` wrapped the text in a `<div style=…>` before posting it, so\nthe check failed and the template — which had existed all along — was never used\nonce. One line removed, and every send became branded.\n\n**So: pass the raw text.** No `<div>`, no `<br>`, no escaping, no pre-formatting.\n\n```bash\nnode agents/reply.mjs --channel email --to <address> --client cl_x \\\n  --subject \"…\" --text-file <plain text file> --agent <you>\n```\n\n`--html <file>` exists for the rare mail you have genuinely designed yourself —\na brochure, a report. Using it for ordinary copy is what breaks the branding.\n\n## Writing the text so the template does its work\n\n- **One blank line between paragraphs.** The template turns them into real\n  paragraphs; single newlines inside a paragraph are joined.\n- **Put the URL on its own line**, after a colon. It becomes the link, and the\n  full address stays readable for a client who forwards the mail.\n- **Write the phone as `+[PHONE]`** — with the plus and spaces. That is\n  the shape the autolinker recognises.\n- **No markdown.** `**bold**` arrives as asterisks; the template is not a\n  markdown renderer.\n- Keep it to 4–6 short paragraphs. The owner's standing instruction: *smaller,\n  resumed, strict to the point.*\n\n## Never bypass mailflow\n\nSending straight through `nodemailer` skips the template, the address gate, the\narchive CC and the log. It is tempting when mailflow misbehaves — it was used\nonce on 04/09 to get past an SMTP rejection, and those three prospects received\nunstyled mail. Fix mailflow instead; that is what\n`brimind-solobro-clear-the-barrier` is for.\n\n## Before the first send of a batch\n\nSend **one copy to the owner at `[EMAIL]`, exactly as the client will\nreceive it** — same subject, same body, nothing added around it, no explanatory\nwrapper. He reads it on a phone and that is where a dead link or a broken layout\nshows up. Then send the batch.\n\nCheck the link itself with `brimind-solobro-check-the-link-the-client-opens`\nbefore it goes anywhere: a beautiful mail carrying a page priced in the wrong\ncurrency is worse than a plain one that is right.\n\n## Where things are\n\n| | |\n|---|---|\n| Template | `mailflow/lib/emailTemplate.ts` — `renderEmail`, `wrapPlainText`, brand tokens |\n| Applied in | `mailflow/lib/smtpEngine.ts` |\n| Sending sender | `MAILFLOW_REPLY_FROM` in `mailflow/.env` — must match the authenticated SMTP account, or the server answers `553 Sender address rejected` |\n| Archive copy | `MAILFLOW_ALWAYS_CC` / `MAILFLOW_ALWAYS_BCC` |\n| After editing the template | `npm run build && launchctl kickstart -k gui/$(id -u)/pro.brimind.unitary.mailflow` — the running service serves a build, not your source |\n\nNote for whoever edits the template: it is one long TypeScript template literal.\nA backtick in a comment inside it ends the string and the build fails with a\nbare \"Syntax Error\" — write comments without backticks.\n","linked_files":[],"origin":"brimind","owner_id":null,"source":"router"}