This WordPress free plugin helped “Contact Form Auto Responder” that sends an instant, personalized auto-reply to users who submit a Contact Form 7 form. The plugin is designed for non-coders, with a settings page to customize the auto-reply subject, content, and sender details. It integrates with Contact Form 7’s submission process, supports dynamic placeholders for form fields (e.g., user’s name, email), and uses WordPress’s wp_mail() function for reliable email delivery. The plugin is lightweight, secure, and includes an admin page with configuration instructions.
Note: This plugin requires Contact Form 7, a popular free form plugin with over 10 million active installations.
📥 My Awesome Plugin
This plugin helps you automate tasks and improve web performance.
⬇️ Download Plugin ZIP💌 Subscribe to Updates
Installation and Setup Instructions
- Install Contact Form 7:
- In your WordPress admin dashboard, go to Plugins > Add New.
- Search for Contact Form 7, install, and activate it.
- Download the Plugin:
- Copy the PHP code above into a file named wp-contact-form-auto-responder.php.
- Place this file in a folder named wp-contact-form-auto-responder.
- Upload to WordPress:
- Zip the wp-contact-form-auto-responder folder.
- In the WordPress admin dashboard, go to Plugins > Add New > Upload Plugin.
- Upload the zipped folder and click Install Now.
- Activate the Plugin:
- After installation, click Activate Plugin.
- Configure Auto-Reply Settings:
- In the WordPress admin dashboard, go to the new menu item Auto Responder.
- Configure the following:
- Enable Auto-Reply: Check to enable auto-replies (default: enabled).
- Sender Name: Set the name shown as the email sender (default: site name).
- Sender Email: Set the email address used as the sender (default: admin email).
- Email Subject: Customize the subject with Contact Form 7 tags (default: “Thank You for Your Submission!”).
- Email Content: Edit the email body using the WordPress editor, with Contact Form 7 tags and site placeholders (default: a thank-you message with name, email, and message).
- Click Save Changes.
- Set Up Contact Form 7:
- Create or edit a form in Contact > Add New or Edit.
- Ensure the form includes an email field named your-email (default in Contact Form 7 templates) for the recipient address.
- Example form fields: [text* your-name], [email* your-email], [textarea your-message].
- Test the Auto-Reply:
- Submit the form via your site’s front-end.
- Check the email address used in the form’s your-email field (and spam folder) for the auto-reply.
- Verify that placeholders (e.g., [your-name], [your-email]) are replaced correctly.
- Ensure Email Delivery:
- Test email sending using a plugin like Check & Log Email to confirm your server can send emails.
- If emails don’t deliver, install an SMTP plugin (e.g., WP Mail SMTP) and configure it with a service like Gmail or SendGrid for better reliability.
Features
- Instant Auto-Replies: Sends a personalized email to form submitters immediately after submission.
- Customizable Content: Edit the email subject and body with a WYSIWYG editor, supporting Contact Form 7 field tags (e.g., [your-name], [your-email]).
- Dynamic Placeholders: Supports form fields (e.g., [your-name], [your-message]) and site data ([site_name], [site_url], [admin_email]).
- Sender Customization: Set custom sender name and email address.
- HTML Emails: Sends emails in HTML format for better formatting and styling.
- Simple Interface: User-friendly settings page for non-coders.
- Admin Instructions: Includes setup guidance on the settings page.
- Single File: All functionality is contained in one PHP file.
- Secure: Uses WordPress best practices for data sanitization, email headers, and hooks.
How It Works
- The plugin hooks into Contact Form 7’s wpcf7_mail_sent action to trigger an auto-reply after a form submission.
- It retrieves form data and replaces Contact Form 7 tags and site placeholders in the email subject and content.
- The recipient email is extracted from the form’s your-email field (configurable in Contact Form 7).
- The email is sent using wp_mail() with HTML content and custom sender details.
- Sender name and email are filtered via wp_mail_from and wp_mail_from_name for consistency.
- Errors (e.g., failed email delivery, missing email field) are logged to the WordPress debug log if debugging is enabled (define(‘WP_DEBUG’, true); in wp-config.php).
Notes
- Dependencies: Requires Contact Form 7 to be installed and activated. A notice will appear if it’s missing.
- Email Delivery: Relies on your server’s email configuration. Use an SMTP plugin for reliable delivery, especially on shared hosting.
- Form Field Requirement: The form must include an email field named your-email (standard in Contact Form 7). If using a different field name, modify the plugin code or ensure the field is mapped correctly.
- Placeholders: Use Contact Form 7 tags exactly as defined in the form (e.g., [your-name], not [name]). All form fields are supported as placeholders.
- Performance: Email sending occurs after form submission, with minimal impact on user experience.
- Compatibility: Works with WordPress 5.0+ and Contact Form 7 5.0+. Test with CF7 add-ons for compatibility.
- Security: All inputs are sanitized, and email headers are properly formatted to prevent injection attacks.
- Webloop Integration: Based on your interest in automation and services like those offered by Webloop (e.g., business automation, web development), this plugin can be branded for Webloop clients to enhance customer communication with automated responses, potentially integrating with Webloop’s AI tools for dynamic content generation.
Troubleshooting
- Emails Not Sending: Test with Check & Log Email. Configure an SMTP plugin if needed. Check the debug log (wp-content/debug.log) for errors.
- Placeholders Not Replaced: Ensure form field tags match the placeholders in the settings (e.g., [your-name] for a field named your-name).
- No Email Field: Verify the form has an email field named your-email. If using a different name, update the plugin’s $recipient_email logic or rename the field in Contact Form 7.
- Formatting Issues: Emails are sent as HTML. If they appear plain, check your email client settings or SMTP configuration.
- Spam Folder: Add the sender email to your email client’s safe list to prevent auto-replies from going to spam.
- Form Not Triggering: Ensure Contact Form 7 is active and the form is set up correctly. Test a submission without the auto-reply to isolate issues.
This plugin is ready to use and provides a seamless way to send instant, personalized auto-replies to Contact Form 7 submissions, improving user engagement. Let me know if you need additional features (e.g., per-form auto-replies, support for other form plugins, or integration with Webloop’s AI tools) or help with setup!