Skip to main content
PRO Only
Pro Feature

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:

  1. Email capture modal opens
  2. User fills out form
  3. Form is validated
  4. Data is saved to download log
  5. Newsletter subscription processed (if enabled)
  6. Download begins
  7. 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

  1. Check "Enable email capture"
  2. Configure capture settings
  3. 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:

  1. Go to Tracking > Required Fields
  2. Check "First Name" and/or "Last Name"
  3. 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_email
  • somdn_user_fname
  • somdn_user_lname
  • somdn_user_tel
  • somdn_user_company
  • somdn_user_website
  • somdn_user_subbed (newsletter subscription status)

Accessing Data

View captured data:

  1. Go to Pro Edition > Tracking
  2. Click any download log
  3. View user information

Export data:

  1. Go to Pro Edition > Statistics
  2. Configure export settings
  3. Include email and name columns
  4. Export to CSV/XLSX

See Download Tracking for details.

Integration with MailChimp

Automatic Subscription

When newsletter subscription is enabled:

  1. User checks subscription box (or auto-subscribed)
  2. Download is logged
  3. User is added to MailChimp list
  4. Tags are applied (optional)
  5. Welcome email sent (if double opt-in disabled)

Configuration

  1. Go to Pro Edition > Newsletter
  2. Enter MailChimp API key
  3. Select MailChimp list
  4. Configure subscription options
  5. 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

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:

  1. ✅ Verify email capture is enabled
  2. ✅ Check user is not logged in (if "guests only")
  3. ✅ Clear browser cache
  4. ✅ Check for JavaScript errors
  5. ✅ Test with different browser

Form Not Submitting

If form doesn't submit:

  1. ✅ Check required fields are filled
  2. ✅ Verify email format is valid
  3. ✅ Look for JavaScript errors
  4. ✅ Check nonce hasn't expired
  5. ✅ Verify AJAX is working

Data Not Saving

If captured data isn't saved:

  1. ✅ Check tracking is enabled
  2. ✅ Verify database write permissions
  3. ✅ Look for PHP errors
  4. ✅ Check field names match
  5. ✅ Test with debug mode enabled

Spam Submissions

If receiving spam:

  1. ✅ Verify honeypot is working
  2. ✅ Check time-based validation
  3. ✅ Add custom email validation
  4. ✅ Block disposable email domains
  5. ✅ 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