# DEI Realty — the HTML shell # Instructions for an agent composing an email. # # Self-contained on purpose. Everything needed to produce a correct branded # email is in this file; you do not need the repository. # # Fetch: https://deirealty.op-site.net/email/client.html # https://deirealty.op-site.net/email/team.html # https://deirealty.op-site.net/email/agent.txt (this file) ## 0 · Before anything — two blockers you must know about ⚠️ THE POSTAL ADDRESS IS REQUIRED AND IS NOT KNOWN. CAN-SPAM requires a valid physical postal address in every commercial email. DEI Realty does not publish one: the site footer carries a phone and "by appointment across Chicago and the surrounding area", and nothing else. It has deliberately NOT been invented. Supply the real registered address in {{postalAddress}}. The renderer THROWS rather than produce a client email without it — that is intentional, not a bug to work around. ⚠️ DEI REALTY HAS NO EMAIL SENDING ADDRESS YET. Notion's "Live Data — Realty" records the SMS number as +1 630-333-9073 and the email as "not yet set". Confirm the from-address with the operator before any send. ## 1 · Pick the shell CLIENT — external. Buyers, sellers, leads. Full lockup, the ink footer with DEI's registered tagline, the phone, Equal Housing Opportunity, and the unsubscribe. Identical for every agent: a client should not care which system wrote to them. The address, the Equal Housing line and the opt-out are required, not decorative. TEAM — internal. DEI Realty staff: agents, transaction coordinators, brokers. Agent output, handoffs, ops reporting. Compact header that names the sending agent. NO tagline, NO postal address, NO Equal Housing line, NO unsubscribe — internal mail is not commercial email, and an opt-out link on staff mail implies a staff member can opt out of being told a closing moved. ROUTING: decide by RECIPIENT, not by inspecting the body. Going to a client, lead or member of the public -> client Going to someone who works at DEI Realty -> team Note for anyone who knows the Chicago shell: that one derives its routing from the stored templates, because Chicago's template table has 77 rows with a recognisable manager-facing subset. DEI REALTY'S TABLE HAS NO EMAIL BODIES AT ALL — its six rows are SMS only. There is no data here to derive a rule from, so do not invent one. Use the recipient. ## 2 · Normalize the body BEFORE putting it in the shell DEI Realty has not written its email templates yet, so today most bodies will be text you compose. Normalize anyway — the moment templates are authored, the same hazard that bit Chicago applies here, and the step is cheap. 1. STRIP ANY OPT-OUT THE BODY BROUGHT WITH IT. Remove a trailing

containing {optOutLink}, or "want to receive future emails", or "unsubscribe anytime", or a bare whose href is {optOutLink}. The shell owns the opt-out; a body carrying its own gives the reader two. 2. IF THE BODY ALREADY CONTAINS A BLOCK TAG —

,

, ,

-

,
    ,
      ,
    1. ,
      ,
      , 
      — it is real HTML. Do not wrap it, do not escape it, do not second-guess it. 3. IN THAT HTML, CONVERT NEWLINES THAT SIT BETWEEN TEXT into
      . A signature or a details block written as three lines will otherwise arrive as one, because HTML collapses newlines to spaces. Convert only a newline with text on its left; leave newlines between tags alone. 4. OTHERWISE IT IS PLAIN TEXT. Escape & < > , split on blank lines into paragraphs, turn remaining single newlines into
      , wrap each paragraph in

      ...

      . ## 3 · Fill the shell CLIENT — four slots: {{preheader}} one line, ~90 characters. The grey text after the subject in the inbox list. Leave it empty and the client scrapes the first words of the body instead, which is usually worse. {{emailBody}} the normalized body from step 2. Triple brace in the file — raw HTML, not escaped. {{contactId}} the contact's Notion page id. It becomes /email-unsubscribe?id=. {{postalAddress}} see section 0. Required. TEAM — three slots: {{agent}} the sending agent's code: CSA, SMA, LGA, LA or PUA. {{preheader}} {{emailBody}} Replace EVERY occurrence of each token, not just the first. Each shell documents its own tokens in the comment at its top, so the first occurrence of {{preheader}} is that documentation — a single-occurrence replace substitutes the comment and leaves the real token sitting in the markup. The SUBJECT LINE is an email header, not markup. It is not in either file. ## 4 · Merge tokens do not collide {singleBrace} DEI's own — {sellerName}, {firstName}, {propertyAddress}, {reviewLink}, {agentFirstName} ... {{doubleBrace}} the shell's slots — {{preheader}}, {{agent}}, {{contactId}}, {{postalAddress}} Leave DEI's single-brace tokens exactly as they are. They are substituted downstream, after the shell is filled. ## 5 · The opt-out https://deirealty.op-site.net/email-unsubscribe?id= This is DEI REALTY'S OWN opt-out, on DEI Realty's own site. It shares a link SHAPE with the Diamond Equity corporate page and nothing else — different business, different list. Never point a DEI Realty email at the Diamond Equity opt-out, or at any other host. `/unsubscribe` and `/email-opt-out` are permanent aliases and render the same page, because links already sent must never break. ## 6 · Check your work before sending · No "{{" remains anywhere outside an HTML comment. · A CLIENT email shows exactly ONE visible Unsubscribe link. Note the href itself contains "email-unsubscribe", so a case-insensitive count of the word finds two in a CORRECT email — count the anchor text. · A CLIENT email carries the Equal Housing Opportunity line and a real postal address. · A TEAM email shows NO unsubscribe, NO postal address and NO Equal Housing line. · No "{optOutLink}" survives anywhere. · The body sits inside the well — you have added no header, footer, logo or signature of your own. The frame is already built. ## 7 · What you must not change · Colour. Three values in the shells deliberately differ from the live site at the same size because the site's values fail WCAG AA, and an email has no zoom affordance and a legally required line to read: - small text and links use logo-red #C43C3C (4.75:1 on bone), not brass #DF3A3A (4.03:1). White on #C43C3C is 5.30:1; white on #DF3A3A is 4.46:1 and misses. - meta text on bone uses stone #4A4A46 (7.38:1), not the v3 stylesheet's #8A857B (3.28:1). - in the ink footer, small labels are bone rather than red; red on ink is 4.12:1 and fails. All three replacements are DEI Realty brand tokens. Do not "restore" the site values here. · One red moment per view. Red means action or series in this brand. · No capsule or pill tags, no blurred text, no glow text, no gradient blobs. · Do not edit the shells to suit one email. If a send needs something the shell cannot express, say so rather than modifying the frame. ## 8 · Provenance Canonical source is the private repo melockhart/dei-realty → public/email/ and scripts/email-shell.mjs. This host is a published copy. Never edit here. ⚠️ This is DEI Series LLC. It shares no code, tokens, components or content with the Diamond Equity Investments repo. That shell looks nothing like this one on purpose — different business, different brand, and red is DEI Realty's action colour where Diamond Equity removed it. Do not carry anything across.