Overview
Arte y Web provides two form components for different use cases: FormMautic for advanced CRM integration with robust spam protection, and FormSimple for basic contact forms powered by Netlify.FormMautic
Advanced form component that integrates with Mautic CRM and includes comprehensive client-side spam protection.Props
The Mautic form ID to load. This corresponds to a form created in your Mautic instance.
Features
CRM Integration
Direct integration with Mautic marketing automation platform for lead capture and nurturing.
Spam Protection
Multi-layer spam detection including honeypot, timing checks, gibberish detection, and field validation.
Phone Validation
Real-time phone number validation with pattern matching and letter blocking.
Redirect Override
Automatic redirect to local thank-you page instead of external URLs.
Usage
Spam Protection Features
The FormMautic component implements multiple layers of spam protection:1. Submission Timing (3-second minimum)
1. Submission Timing (3-second minimum)
Blocks submissions that occur too quickly after page load (< 3 seconds), a common bot behavior.
2. Honeypot Field
2. Honeypot Field
Hidden field that should remain empty. Bots typically fill all fields, triggering detection.
3. Gibberish Detection
3. Gibberish Detection
Analyzes text input for patterns common in bot submissions:
- Consonant clusters (5+ consonants in a row)
- Low vowel ratio (< 15% for words > 5 letters)
- Suspicious mixed case patterns
- No spaces in long strings
4. Phone Validation
4. Phone Validation
Enforces strict phone number validation:
- No letters allowed
- Minimum 6 digits required
- Only allows: numbers, spaces, +, (, ), -
- Real-time input filtering
- HTML5 pattern attribute for native validation
5. Field Content Validation
5. Field Content Validation
Validates that at least one field is filled and checks for valid email/phone formats.
Configuration
Mautic Server URL
The component loads scripts from the Mautic server. Update the URL in the component if using a different instance:Redirect URL
The component automatically overrides Mautic’s redirect to use a local thank-you page:Ensure you have a
/recibido-ok page created for successful form submissions.Form Field Detection
The component robustly detects form fields using multiple strategies:Error Handling
The component displays user-friendly error messages:- “El nombre no parece válido. Por favor, revísalo.”
- “El teléfono NO puede contener letras.”
- “El teléfono debe contener al menos 6 dígitos.”
- “Por favor, rellena al menos un campo de contacto.”
FormSimple
A lightweight contact form powered by Netlify Forms. Perfect for simple contact pages without CRM requirements.Props
No props required - the component is self-contained.Features
Netlify Integration
Automatic form handling via Netlify’s built-in form detection.
Honeypot Protection
Basic spam protection with honeypot field.
Responsive Design
Mobile-optimized with Tailwind CSS styling.
Required Validation
HTML5 required attributes for client-side validation.
Usage
Form Fields
The component includes three fields:Contact name - required field with text input
Email address - required field with email validation
Message content - required multiline text area (5 rows)
Netlify Configuration
The form includes required Netlify attributes:When deploying to Netlify, the form is automatically detected and submissions are available in the Netlify dashboard under Forms.
Styling
The form uses Tailwind CSS utility classes:Comparison
Use FormMautic When...
- You need CRM integration
- Lead tracking is important
- You want advanced spam protection
- Marketing automation is required
- You need detailed form analytics
Use FormSimple When...
- Simple contact form is sufficient
- Deploying to Netlify
- No CRM integration needed
- Minimal setup preferred
- Basic spam protection is enough
Best Practices
Test Spam Protection
For FormMautic, test the spam protection:
- Submit too quickly (< 3 seconds)
- Enter gibberish in name field
- Enter letters in phone field
- Leave all fields empty
Configure Mautic Forms
In Mautic dashboard:
- Create form with matching field names
- Set up email notifications
- Configure post-submit actions
- Test form in Mautic first
Troubleshooting
FormMautic not loading
FormMautic not loading
Check:
- Mautic server URL is accessible
- Form ID exists in Mautic
- JavaScript console for errors
- Network tab for failed script loads
src/components/FormMautic.astro:10-14Spam protection too strict
Spam protection too strict
Adjust thresholds in the spam protection code:Component reference:
src/components/FormMautic.astro:169-233Netlify form not receiving submissions
Netlify form not receiving submissions
Ensure:
data-netlify="true"attribute is present- Hidden
form-nameinput matches form name - Form is in the deployed HTML (not added via JS)
- Honeypot field name matches
netlify-honeypotattribute
Source Code References
- FormMautic:
src/components/FormMautic.astro:1-296 - FormSimple:
src/components/FormSimple.astro:1-73