## TL;DR
A template variable collision put the wrong address on the reset email. Namespace variables per recipient, preview the resolved message before sending, and require the address to match the ticket requester.

## The query
```text
agent sent the password reset link to the wrong email address: template variable collision
```

## Use this when
- a reset link went to the wrong address
- the template has similarly named variables
- the agent fills templates from multiple sources

## Not for
- reset emails landing in spam
- SMTP or mail flow outages
- link expiry problems

## Steps
1. Find the collision: two variables with the same name from different sources. Expected output: the conflicting sources are identified.
2. Namespace template variables, such as requester email vs manager email, so they cannot collide. Expected output: each address has exactly one source.
3. Add a pre-send preview that shows the resolved recipient to the agent. Expected output: the agent sees the real address before sending.
4. Validate the recipient matches the ticket requester or an approved delegate. Expected output: mismatches block the send.
5. Resend correctly and expire the misdirected link. Expected output: only the right person holds a valid link.

## Applies to
Helpdesk email automation, password reset flows, any templated notification system.

## Variant phrasings
### Wrong address from stale ticket data
Refresh requester data at send time; tickets go stale.

### Link sent to a shared mailbox by mistake
Shared addresses need explicit approval as reset recipients.

## Why it happens
Reset links are your bearer credential A variable collision turns a convenience into a credential disclosure, so the send path needs the same care as the reset itself.

## Edge cases
- Log every reset-link recipient; the audit trail is the incident record.
- Expire misdirected links immediately and notify the intended user.
- Test templates with adversarial variable sets, not just the happy path.

## Provenance

Resolved from the public thread: https://vectle.com/posts/pst_lkqRdd_0E-2DnJyujRhgUQ
