This feature is only available in the Pro edition. Upgrade to Pro to access email capture.
Pro: Email Capture
Email Capture collects user information before allowing downloads. This builds your email list, enables personalized marketing, and provides valuable customer data—all without requiring account creation.
Overview
Email Capture displays a modal form before downloads, collecting:
- Email Address (required)
- First Name (optional)
- Last Name (optional)
- Phone Number (optional)
- Company (optional)
- Website (optional)
- Newsletter Subscription (optional)
How It Works
Capture Flow
When a user clicks download:
- Email capture modal opens
- User fills out form
- Form is validated
- Data is saved to download log
- Newsletter subscription processed (if enabled)
- Download begins
- Modal closes
For Returning Users
Users who previously provided their email:
- Email is remembered via cookie
- Form pre-fills with saved data
- Can update information if desired
- One-click download after first time
For Logged-In Users
Behavior depends on settings:
- Capture from all users: Shows form even for logged-in users
- Capture from guests only: Skips form for logged-in users
- User data auto-fills from WordPress profile
Enabling Email Capture
Settings Location
Go to WP Enhanced > Free Download Woo, then click Tracking in the sidebar
Enable Capture
- Check "Enable email capture"
- Configure capture settings
- Save changes
Configuration Options
Capture Users:
- All users: Show form to everyone
- Guests only: Skip form for logged-in users
Required Fields:
- Email (always required)
- First Name
- Last Name
- Phone
- Company
- Website
Newsletter Subscription:
- Disabled
- Optional checkbox
- Text only (no checkbox)
- Hidden (auto-subscribe)
- Required checkbox
Form Fields
Email Address
Always required. Validated for:
- Valid email format
- Not empty
- Not spam patterns
Validation:
// Email must match standard format
/^[^\s@]+@[^\s@]+\.[^\s@]+$/
Name Fields
First Name and Last Name are optional by default.
Make required in settings:
- Go to Tracking > Required Fields
- Check "First Name" and/or "Last Name"
- Save settings
Phone Number
Optional field for phone numbers.
Validation:
- Accepts various formats
- International numbers supported
- No strict format enforcement
Company
Optional field for business name.
Use cases:
- B2B lead generation
- Market segmentation
- Personalized follow-up
Website
Optional field for website URL.
Validation:
- Must be valid URL format
- Accepts http:// or https://
- Optional field
Newsletter Subscription
Optional checkbox for newsletter signup.
Display Options:
- Optional checkbox: User chooses to subscribe
- Text only: Informational text, no checkbox
- Hidden: Auto-subscribe all users
- Required checkbox: Must check to download
See MailChimp Integration for newsletter setup.
Spam Prevention
Built-In Protection
Email capture includes multiple spam prevention measures:
Honeypot Field:
- Hidden field that bots fill out
- Legitimate users never see it
- Submissions with honeypot filled are rejected
Time-Based Validation:
- Minimum 2 seconds between page load and submission
- Prevents instant bot submissions
- Legitimate users unaffected
Nonce Verification:
- WordPress security token
- Prevents CSRF attacks
- Expires after 24 hours
Email Validation:
- Server-side format checking
- Disposable email detection (optional)
- Duplicate submission prevention
Additional Protection
Add custom validation:
add_filter('somdn_capture_email_invalid', function($invalid, $email) {
// Block specific domains
$blocked_domains = array('tempmail.com', 'throwaway.email');
$domain = substr(strrchr($email, "@"), 1);
if (in_array($domain, $blocked_domains)) {
return true; // Mark as invalid
}
return $invalid;
}, 10, 2);
Customizing the Form
Form Appearance
The email capture modal uses your theme's styles by default.
Custom CSS:
/* Modal container */
.somdn-capture-email-wrap {
background: white;
border-radius: 8px;
padding: 30px;
}
/* Form fields */
.somdn-download-user-name {
border: 1px solid #ddd;
padding: 10px;
border-radius: 4px;
}
/* Submit button */
.somdn-download-button {
background: #0073aa;
color: white;
padding: 12px 24px;
}
Form Text
Customize form labels and messages:
add_filter('somdn_capture_email_label', function($label) {
return 'Enter your email to download:';
});
add_filter('somdn_capture_fname_label', function($label) {
return 'Your first name:';
});
Adding Custom Fields
Add additional form fields:
add_action('somdn_capture_after_sub_inputs', function($user_id, $email) {
?>
<div class="somdn-capture-name-input-wrap">
<input
type="text"
name="custom_field"
class="somdn-download-user-name somdn-capture-required"
placeholder="Custom Field..."
>
</div>
<?php
}, 10, 2);
Save custom field data:
add_action('somdn_count_download_post_success', function($post_id) {
$custom_value = sanitize_text_field($_POST['custom_field'] ?? '');
if ($custom_value) {
add_post_meta($post_id, 'custom_field', $custom_value);
}
});
Data Storage
Where Data is Stored
Captured data is saved in download tracking logs:
Post Type: somdn_tracked
Post Meta:
somdn_user_emailsomdn_user_fnamesomdn_user_lnamesomdn_user_telsomdn_user_companysomdn_user_websitesomdn_user_subbed(newsletter subscription status)
Accessing Data
View captured data:
- Go to Pro Edition > Tracking
- Click any download log
- View user information
Export data:
- Go to Pro Edition > Statistics
- Configure export settings
- Include email and name columns
- Export to CSV/XLSX
See Download Tracking for details.
Integration with MailChimp
Automatic Subscription
When newsletter subscription is enabled:
- User checks subscription box (or auto-subscribed)
- Download is logged
- User is added to MailChimp list
- Tags are applied (optional)
- Welcome email sent (if double opt-in disabled)
Configuration
- Go to Pro Edition > Newsletter
- Enter MailChimp API key
- Select MailChimp list
- Configure subscription options
- Save settings
See MailChimp Integration for complete setup.
Use Cases
Lead Generation
Build email lists for marketing:
- Collect emails from all downloads
- Export to email marketing platform
- Segment by downloaded product
- Nurture leads with targeted campaigns
Personalization
Use captured data for personalization:
- Address users by name in emails
- Segment by company or industry
- Tailor content to user interests
- Track user journey
Market Research
Understand your audience:
- Which companies download what?
- What industries are interested?
- Geographic distribution (via IP)
- Popular content by segment
Compliance
Meet legal requirements:
- Collect consent for marketing
- Document opt-in timestamps
- Provide unsubscribe options
- Honor data deletion requests
Privacy and GDPR
Consent
Email capture should include:
- Clear explanation of data use
- Opt-in for marketing (not pre-checked)
- Link to privacy policy
- Option to decline (no download)
Data Protection
Protect captured data:
- Secure database storage
- HTTPS for form submission
- Limited access to data
- Regular security audits
User Rights
Provide users with:
- Access to their data
- Ability to update information
- Option to delete data
- Unsubscribe from emails
Privacy Policy
Update your privacy policy to mention:
- What data is collected
- How data is used
- Who has access
- How long data is retained
- User rights
Troubleshooting
Form Not Appearing
If email capture doesn't show:
- ✅ Verify email capture is enabled
- ✅ Check user is not logged in (if "guests only")
- ✅ Clear browser cache
- ✅ Check for JavaScript errors
- ✅ Test with different browser
Form Not Submitting
If form doesn't submit:
- ✅ Check required fields are filled
- ✅ Verify email format is valid
- ✅ Look for JavaScript errors
- ✅ Check nonce hasn't expired
- ✅ Verify AJAX is working
Data Not Saving
If captured data isn't saved:
- ✅ Check tracking is enabled
- ✅ Verify database write permissions
- ✅ Look for PHP errors
- ✅ Check field names match
- ✅ Test with debug mode enabled
Spam Submissions
If receiving spam:
- ✅ Verify honeypot is working
- ✅ Check time-based validation
- ✅ Add custom email validation
- ✅ Block disposable email domains
- ✅ Consider adding CAPTCHA
Developer Hooks
Filters
somdn_capture_email_invalid
Validate email addresses.
add_filter('somdn_capture_email_invalid', function($invalid, $email) {
// Custom validation
return $invalid;
}, 10, 2);
somdn_capture_email_empty
Customize "email required" error.
add_filter('somdn_capture_email_empty', function($message) {
return 'Please provide your email address.';
});
capture_emails_active
Override whether email capture is active.
add_filter('capture_emails_active', function($active) {
// Disable for specific products
if (is_product() && get_the_ID() == 123) {
return false;
}
return $active;
});
Actions
somdn_capture_after_sub_inputs
Add custom form fields.
add_action('somdn_capture_after_sub_inputs', function($user_id, $email) {
// Output custom fields
}, 10, 2);
somdn_count_download_post_success
Process captured data.
add_action('somdn_count_download_post_success', function($post_id) {
// Save custom field data
});
Best Practices
Form Design
- Keep it simple: Only ask for essential information
- Clear labels: Use descriptive field labels
- Mobile-friendly: Ensure form works on mobile
- Fast loading: Optimize modal performance
Data Collection
- Minimal fields: Only collect what you need
- Optional fields: Make most fields optional
- Clear purpose: Explain why you need data
- Secure storage: Protect user information
User Experience
- Quick process: Make form submission fast
- Pre-fill data: Remember returning users
- Clear errors: Show helpful error messages
- Thank you: Confirm successful submission
Compliance
- Get consent: Use opt-in checkboxes
- Privacy policy: Link to privacy policy
- Unsubscribe: Provide easy unsubscribe
- Data deletion: Honor deletion requests
Related Topics
- Download Tracking - Where data is stored
- MailChimp Integration - Newsletter integration
- Statistics & Reports - Export captured data
- Settings Reference Pro - Complete Pro settings