Documentation · Troubleshooting

Email and Lead Errors

This document covers problems related to the vehicle inquiry form, test drive booking form, email delivery, lead management and notification settings in the ADP Car Market Hub plugin.

When to use this document

Read this document when:

  • Visitors submit the contact form but no notification email arrives at the dealer or the configured recipient.
  • Visitors do not receive a confirmation email after submitting an inquiry.
  • The form submission appears to succeed (visitor sees a success message) but no lead is saved in the admin.
  • The form returns an error message or redirects to an error state.
  • The form submission is blocked by spam protection.
  • Email notifications are going to the wrong recipient.
  • Custom email subjects or body templates with placeholders are not rendering correctly.
  • The consent checkbox is missing or the form cannot be submitted.

Overview

The plugin's built-in contact form processes vehicle inquiries and test-drive requests submitted by site visitors. When a valid form is submitted:

  1. A notification email is sent to the dealer recipient.
  2. A confirmation email is sent to the visitor (the lead).
  3. The lead details are saved as a WordPress custom post (as24ci_lead) and can be reviewed in the plugin's admin Leads section.
  4. A lead analytics event is tracked (if analytics is enabled).

Both emails are sent using WordPress's wp_mail() function. Delivery depends on the site's mail configuration, which may use PHP's built-in mail() function or a third-party SMTP plugin.

Spam protection

The form uses two layers of protection:

  • Honeypot field: a hidden field named website is included in the form. If a bot fills it in, the submission is treated as successful from the visitor's perspective but is silently discarded without sending any email.
  • Rate limiting: a maximum of 5 submissions per IP address per 5-minute window is enforced using a WordPress transient. Submissions beyond this limit redirect the visitor to an error state.

Recipient resolution

The dealer notification email is sent to the first valid address found in this priority chain:

  1. Global override (LEAD_RECIPIENT_EMAIL setting): one or more comma-separated email addresses configured in the plugin settings. All valid addresses in this list receive the notification.
  2. Seller profile email: a custom email address stored in the as24ci_seller_email user meta field for the user associated with the vehicle.
  3. WordPress author email: the email address of the WordPress user assigned as the post author of the vehicle.
  4. Admin email fallback: the WordPress site admin email (admin_email option).

Prerequisites

  • At least one vehicle post is published for the form to be associated with.
  • The site can send emails. Verify by using Tools → Site Health or a transactional email test plugin.
  • For SMTP delivery: an SMTP plugin (such as WP Mail SMTP) is configured with valid credentials.

Diagnostic steps

Step 1: Confirm email delivery is working

Before investigating the plugin specifically, confirm that WordPress can send email at all:

  1. Use a plugin such as WP Mail SMTP (or any WordPress email test tool) to send a test email.
  2. If the test email is not received, the problem is with the mail transport configuration, not with the plugin. Configure an SMTP plugin or contact your hosting provider.

Step 2: Check the lead was saved

Even when email delivery fails, the plugin saves the lead to the database (unless the form submission was blocked by the honeypot or rate limiter):

  1. Go to the plugin's admin Leads section.
  2. Find the most recent lead and confirm the details are present (name, email, vehicle).
  3. Check the email_sent field. If it shows 0, the wp_mail() call returned false for one or both of the emails.
  4. If no lead entry exists, either the form was not submitted at all, it was caught by the honeypot, or the as24ci_lead CPT failed to save (check the PHP error log).

Step 3: Verify the recipient email address

  1. Go to the plugin settings and look for Lead recipient email (the global override).
  2. If this field is empty, the plugin falls back to the seller profile email or the post author's WordPress email.
  3. Verify that the resolved recipient address is a valid, deliverable email address by checking: - The value in the plugin's lead recipient setting. - The as24ci_seller_email user meta for the seller user (if applicable). - The WordPress user account email for the post author. - The WordPress admin email (Settings → General → Administration Email Address).

Step 4: Check for email filtering and spam folders

  1. Ask the intended recipient to check their spam or junk folder.
  2. Email from WordPress using PHP mail() often lacks proper SPF/DKIM authentication and is frequently marked as spam. Installing and configuring an SMTP plugin significantly improves deliverability.
  3. If using SMTP, confirm the credentials are correct and the SMTP provider is not blocking the domain or IP address of the server.

Step 5: Investigate the form error state

If the form redirects to an error message (the URL contains as24ci_contact_ok=0), the likely causes are:

  • Invalid or missing required fields: the form requires a valid vehicle ID, a non-empty name, and a valid email address. If the message field is enabled (default), a non-empty message is also required.
  • Rate limit exceeded: more than 5 submissions from the same IP address in a 5-minute window. The visitor must wait before submitting again.
  • wp_mail() failed: both emails returned false. The lead is still saved but the error state is shown to the visitor.

To determine which cause applies, review the leads admin list to see whether an entry was created, and check the email_sent field.

If the form cannot be submitted because the consent checkbox is required:

  1. Confirm the Require consent option is enabled in the plugin settings (default: enabled).
  2. Confirm the consent label text is set correctly.
  3. If a privacy page URL is configured, confirm the link in the consent label points to the correct page.
  4. The form validates the consent field on the server side. If a visitor does not check it, the submission is rejected and they are redirected to the error state.

Step 7: Verify custom email templates

If custom subject lines or HTML body templates are configured (in the plugin's email settings), check that:

  1. The template is valid HTML.
  2. Placeholder tokens use the correct format: {placeholder_name} with curly braces. Supported placeholders are: - {customer_name} - {customer_email} - {customer_phone} - {customer_message} - {vehicle_title} - {vehicle_url} - {vehicle_price} - {dealer_name} - {listing_id} - {appointment_date}
  3. If a custom template is configured but a placeholder is misspelled, it will appear as the literal text {placeholder_name} in the sent email.
  4. If the custom template field is empty, the plugin uses its built-in HTML template as a fallback.

Step 8: Test drive requests

Test drive form submissions follow the same code path as standard inquiries with additional validation:

  1. Both a date and a time slot must be selected. If either is missing or the date is in the past, the submission falls back to a standard contact inquiry.
  2. The time slot must be one of the available slots returned by the test drive availability API. If no slots are available for the selected date, the slot validation fails.
  3. The subject line and email body for test drive submissions use different default text than standard inquiries ("Test drive request" vs "Vehicle inquiry").

Configuration reference

SettingDescription
Lead recipient emailGlobal override for the notification recipient. Comma-separated for multiple addresses. If empty, the seller or author email is used.
Show Name fieldControls whether the name field is shown (default: shown; always required).
Show Email fieldControls whether the email field is shown (default: shown; always required).
Show Phone fieldControls whether the phone field is shown (default: shown; not required).
Show Message fieldControls whether the message field is shown (default: shown).
Require MessageWhen the message field is shown, an empty message prevents submission.
Require consentWhen enabled, the visitor must check the consent checkbox (default: enabled).
Consent label textCustom text for the consent checkbox label.
Privacy page URLURL of the privacy policy page, linked from the consent label.
Success messageCustom text shown after a successful submission.
Error messageCustom text shown when the submission fails.
Dealer email subjectCustom subject line for the dealer notification. Supports placeholders.
Customer email subjectCustom subject line for the visitor confirmation. Supports placeholders.
Dealer email templateCustom HTML body for the dealer notification. Supports placeholders.
Customer email templateCustom HTML body for the visitor confirmation. Supports placeholders.

Operational notes

  • Both the dealer notification and the visitor confirmation are sent using wp_mail(). If either call returns false, the form redirects to the error state. The lead is still saved regardless.
  • The Reply-To header of the dealer notification email is set to the visitor's name and email address, so the dealer can reply directly to the visitor from their email client.
  • Rate limiting uses a WordPress transient keyed to a SHA-256 hash of the visitor's IP address and the WordPress auth salt. The hash prevents the IP from being stored in plain text. The limit is 5 submissions per IP per 5 minutes.
  • The honeypot field is hidden by CSS in the plugin's templates. If a performance or security plugin strips inline styles or blocks certain CSS classes, the honeypot field may become visible to real visitors. Test the form after enabling security plugins.
  • Leads are stored in a non-public custom post type (as24ci_lead) with status new, contacted, closed or spam. They are visible only in the plugin's admin Leads section, not in the public WordPress post list.
  • The plugin does not store email content or full IP addresses in the database. The lead record stores the contact's name, email, phone, message, vehicle reference, submission date and email delivery status.

Troubleshooting

SymptomLikely causeCheck
No email received by dealerwp_mail() failed or email marked as spamSend a WordPress test email; check spam folder; configure SMTP
No confirmation email received by visitorSame wp_mail() failureCheck leads list for email_sent = 0; verify SMTP
Lead not savedHoneypot triggered or CPT save failedCheck whether a lead entry exists; review PHP error log
Form shows error after submissionMissing required fields, rate limit, or wp_mail() failureCheck URL parameter as24ci_contact_ok=0; review leads list
Form cannot be submitted (consent)Consent checkbox not checkedVisitor must tick consent; verify consent is required in settings
Email goes to wrong recipientRecipient resolution resolving to fallbackSet global override in lead recipient email setting
Placeholder {vehicle_title} shows as literal textTypo in custom templateVerify placeholder spelling in the custom email template
Rate limit blocking legitimate submissionsIP submitting too many requestsWait 5 minutes; if persistent, check for shared NAT or proxy
Test drive date not acceptedDate in the past or invalid formatVerify the visitor selects a future date in the correct format
Test drive time not acceptedSlot not available or invalid formatVerify slots are configured; the slot must be available for the selected date