Notifications (staff email and auto-reply)
This guide is for a Manager or Primary Owner who configures email: staff notifications when a lead is saved, visitor auto-replies, and who receives the internal “To” address. HTTPS webhooks (Zapier, Make, CRM automation) are a separate feature — see Webhooks.
SMTP transport and provider setup: SMTP setup. Mapping webhook JSON to CRMs: CRM & tools.
Staff notification “To”: department routing vs directory routing
These are two different ways to choose which staff inbox receives the internal new-lead email. You can use neither, one, or both; if both apply, directory routing wins when the token is valid, then department routing, then the normal Reply-To / team inbox from Operations.
| Feature | Department routing | Directory routing |
|---|---|---|
| Where you set it up | Settings → Forms → Configure → form builder: add the Department field and set Choices to staff@email|Label lines (one staff inbox per line). | Settings → Forms → same template → Configure → Advanced settings → Use multi-email forward (per-template on/off, token lifetime, optional allowed domains). The signing secret lives in wf_config/private.php and is ensured when you save a form with this option enabled. |
| Who chooses the mailbox | The visitor’s submitted value for one field you pick (usually a select dropdown such as Department). | Your server-side PHP on that page (e.g. listing template) picks the staff email, then mints an opaque token. The browser never sees the email address. |
| Best for | A small fixed list of teams (Sales, Support, Billing) where showing a dropdown is fine. | Many different staff addresses (member directories, franchise listings) where you must not put raw emails in the HTML. |
| Embed code | Normal wckd_form('registry_key', 'Placement label'); — no extra arguments. | Same form key, but pass a third argument: wckd_form('registry_key', 'Placement label', $token);. In <head>, call wckd_form_init('multi-email') once so wf_load_app_config(), wf_get_form_config(), and wf_directory_routing_mint_recipient_token() are available. Load this template’s settings from wf_get_form_config('registry_key')['settings'] (array), then mint with wf_directory_routing_mint_recipient_token($email, wf_load_app_config() ?? [], $formSettings). See Embed forms. |
Department routing — checklist
- Open Settings → Forms → Configure on the template.
- In the form builder, add a Department field (or keep the built-in
wf_departmentrow) and open Choices. - Enter one line per inbox:
staff@example.com|Sales(email first; the visitor’s selection stores that email and staff mail goes there). - If no department field is present or no valid email lines exist, staff mail follows Reply-To and Operations defaults.
- Save the form and submit a test for each choice; confirm the correct address receives the staff notification.
Directory routing — checklist
- Open Settings → Forms → the template you embed on directory-style pages → Configure → under Advanced settings, check Use multi-email forward, set token lifetime and optional allowed domains if needed, then Save Form (a signing secret is written to
wf_config/private.phpwhen missing). - In the PHP template for each page that needs a unique staff inbox, load merged app config, load that template’s
$formSettingsfromwf_get_form_config(), mint a token for that page’s email, and pass it as the third argument towckd_form()(see table above). If the token is empty (feature off for that template, invalid email, or domain not allowed), the form still works; staff mail uses department routing or Reply-To instead. - Submit once and confirm the expected inbox receives the notification.
After browser checks in wckd-forms/submit.php, intake validates the payload and inserts the submission row first. Only then does the app send mail.
- Validate → MySQL INSERT (lead is in the dashboard even if mail fails).
- Staff notification email to the resolved “To” address (see routing above).
- Visitor auto-reply when enabled for that form.
- HTTPS webhooks run after mail attempts — configured separately; see Webhooks.
Important. A failed SMTP send does not remove the row. Check PHP error logs for [wckd-forms intake] mail lines.
Operations supplies the baseline subject and signature when a form omits its own copy.
- Open Settings → Operations.
- Fill default subject and signature fields, then save.
- Send a test submission from a form that inherits those defaults and confirm the notification content.
Settings → Forms stores per-template routing, subjects, auto-reply, department routing, and optional SMTP overrides.
For department routing, read the checklist in Who gets the staff notification? above. It is configured only on this tab, not under Operations.
- Open Settings → Forms and select a registry key.
- Set thank-you and not-sent URLs, subject, reply-to, CC, BCC, and routing toggles.
- Configure department routing in the form builder: on the Department field, set Choices to
staff@email|Labellines (see checklist above). - Configure auto-reply to the visitor (subject, body, optional submission copy).
- Fill custom SMTP only when this template must leave through different credentials than the site default.
- Save the form.
Screenshot. Show the mail block on Settings → Forms for one template.
The transport must be internally consistent or validation fails.
- When SMTP host and username are both non-empty, PHPMailer uses SMTP with the provided port and password.
- When both are empty, the app uses PHP
mail()and requires a valid From address for your host. - Never leave half-filled SMTP (host only, user blank, or the reverse). The installer and settings forms reject that combination.
- Provider-specific steps: SMTP setup.
- No staff mail: invalid Reply-To, SMTP misconfiguration, or empty “To” after routing — row still in inbox.
- Wrong inbox: directory token missing on a directory page, or department choice not mapped — see routing table.
- Confusing webhooks with email: CRM URLs belong under Webhooks, not SMTP settings.
- Webhooks: HTTPS POSTs on new submissions or status changes (not email).
- Operations: shared mail defaults and abuse controls.
- SMTP setup: Mailgun, Postmark, SES, and PHP
mail(). - Embed forms: optional third argument for directory routing.
- CRM & tools: map webhook JSON into external systems.
- Inbox & leads: where status changes originate.