Email notifications
This document describes email notifications in WCKD Forms: staff notification mail, visitor auto-replies, and routing rules that choose which inbox receives staff mail. Webhooks and CRM integrations are documented separately in Webhooks.
How email fits in the pipeline
- The lead is saved to your database first.
- Then WCKD Forms sends the staff notification (who gets it depends on routing below).
- Then the visitor auto-reply runs, if you turned it on for that form.
- Then outbound webhooks fire for
submission_created, if configured. See Webhooks.
If email fails, the lead is still in Inbox. Check your server log for [wckd-forms intake].
Who gets the staff notification?
Only the “To” address on the internal new-lead email is affected. Saving the lead, thank-you page, and inbox row are the same either way.
Priority (staff “To” only): valid directory token → department dropdown → per-form Reply-To (when default routing is off) → Operations Reply-To (smtp_to) → Operations From (smtp_email).
| Department routing | Directory routing | |
|---|---|---|
| Who picks the inbox | The visitor (dropdown) | Your PHP on each page (signed token) |
| Where to configure | Settings → Forms → Configure → form builder → Department field → Choices as staff@email|Label per line | Settings → Forms → Configure → Advanced → Use multi-email forward |
| Best for | A few teams (Sales, Support, Billing) | Many pages with different staff (directories, agent profiles) |
| Email visible on the page? | No — visitors see labels only; stored value is the staff email | No — only a hidden token |
| Embed code | wckd_form('registry_key', 'Placement label'); | wckd_form('registry_key', 'Placement label', $token); plus wckd_form_init('multi-email'); in <head>. See Embed forms. |
Department routing — setup
- Open Settings → Forms → Configure on the template.
- Add or edit a Department field (or
wf_department). - In Choices, add one line per inbox:
staff@example.com|Sales(email first, then label). - Save the form. Submit a test and pick each option — confirm the right person gets mail.
Directory routing — setup
- On the template: Configure → Advanced → enable Use multi-email forward → Save Form.
- On each listing page, set the staff email in PHP and mint a token (see Embed forms).
- Pass the token as the third argument to
wckd_form(). - Submit a test from that page — confirm that inbox receives the staff notification.
Site-wide mail defaults
Settings → Operations holds default subject lines and signature text. Individual forms can override these under Settings → Forms.
- Open Settings → Operations.
- Fill in default subject, signature, From, Reply-To, and SMTP if needed.
- Save.
Per-form mail settings
Open Settings → Forms → choose a template → Configure.
- Thank-you and not-sent URLs
- Subject, Reply-To, CC, BCC
- Auto-reply subject and body (and whether to include a copy of the submission)
- Optional custom SMTP for this template only
- Department routing (form builder) and directory routing (Advanced)
SMTP or PHP mail()
- SMTP — fill in both host and username (and password) to use PHPMailer.
- PHP mail() — leave SMTP host and username empty; you still need a valid From address.
- Do not half-fill SMTP — the settings form will reject it.
Step-by-step for providers: SMTP setup.
Common mistakes
- No staff email arrived — check SMTP, Reply-To, and routing. The lead is still in the inbox.
- Wrong person got mail — check department choices or directory token on that page.
- Looking for Zapier or HubSpot — that is Webhooks, not Notifications.
Related pages
- Webhooks — Zapier, Make, n8n, CRMs (not email).
- Operations — global defaults and SMTP.
- Embed forms — directory token examples.
- Inbox & leads — qualify leads after they arrive.