# Thank-You Page — Contact Information form (form 2)

Personalizes the **Thank-You page** (`/thank-you-contact-information/`) with the
data the visitor just submitted, mirroring the live site's
`inquiries/personalized.blade.php`.

Code: `inc/bw-inquiry-thankyou.php` (loaded from `functions.php`).

---

## How it works

1. On submit, Gravity Forms redirects to the Thank-You page with a **signed
   entry id**, e.g.
   `…/thank-you-contact-information/?eid=1158&t=9fbcf293…`
2. The shortcodes on that page load the real entry **server-side** (only when
   the `t` token matches an HMAC of the id). So:
   - Entry ids can't be guessed to read someone else's submission.
   - No personal data is trusted from the URL — only an id + signature.
   - All output is escaped.
3. Opened directly (no valid token) → shortcodes render empty (or the
   `fallback` text).

Nothing to configure in the Gravity Forms UI — the redirect is wired in the
theme for form id `2`. (Constants at the top of the PHP file let you change the
form id or the page path if needed.)

---

## Shortcodes

Place these anywhere in the Thank-You page content; build the hero / layout /
crest however you like around them.

| Shortcode | Output (example) |
|---|---|
| `[bw_inquiry field="name"]` | `Test` — inquirer's name (parent **or** student, auto) |
| `[bw_inquiry field="email"]` | `test@test.com` — inquirer's email |
| `[bw_inquiry field="grade"]` | `8` — starting grade number |
| `[bw_inquiry field="year"]` | `2026/27` — formatted like live |
| `[bw_inquiry field="year_raw"]` | `2026/2027` — raw value |
| `[bw_inquiry field="question"]` | the "Ask A Question" text |
| `[bw_inquiry_intro]` | the whole intro paragraph (only shows when grade **and** year are present) |

Optional fallback when the page is opened without a submission:
`[bw_inquiry field="name" fallback="there"]`

---

## Copy-paste content (matches the live Thank-You text)

### A) Plain version — paste into Paragraph blocks

```
Welcome [bw_inquiry field="name"]

✉ [bw_inquiry field="email"]

[bw_inquiry_intro]

Thank you for your interest in Brentwood College School. To book a tour of our oceanfront campus, please write to us at admissions@brentwood.ca. If you would like to register for a free virtual open house presentation over zoom, current dates are available on our admissions events page.

We look forward to speaking with you soon.

Brentwood Admissions
+1 (250) 743-8770
admissions@brentwood.ca
```

### B) HTML version — paste into a single **Custom HTML** block (keeps the links)

```html
<h1>Welcome [bw_inquiry field="name"]</h1>

<p class="bw-ty-email">
  <span aria-hidden="true">✉</span>
  <a href="mailto:[bw_inquiry field="email"]">[bw_inquiry field="email"]</a>
</p>

[bw_inquiry_intro]

<p>Thank you for your interest in Brentwood College School. To book a tour of our
oceanfront campus, please write to us at
<a href="mailto:admissions@brentwood.ca">admissions@brentwood.ca</a>. If you would
like to register for a free virtual open house presentation over zoom, current
dates are available on our
<a href="https://www.brentwood.ca/admissions/admissions-events">admissions events page</a>.</p>

<p>We look forward to speaking with you soon.</p>

<p>Brentwood Admissions<br>
<a href="tel:12507438770">+1 (250) 743-8770</a><br>
<a href="mailto:admissions@brentwood.ca">admissions@brentwood.ca</a></p>
```

Notes:
- `[bw_inquiry_intro]` already outputs its own `<p>…</p>` with the bold
  **Grade N student** / **year** spans, so don't wrap it again.
- The `✉` is a placeholder — swap for your own envelope icon (Kadence icon,
  FontAwesome, etc.) if you prefer.
- The crest image, hero photo, "Why Brentwood" cards and footer are page/theme
  layout — add them yourself; only the text above is data-driven.

---

## Live reference

Source of truth: `/srv/apps/brentwood/laravel/resources/views/inquiries/personalized.blade.php`
(the live personalized inquiry view this replicates).
