A WordPress plugin that allows you to create forms to capture user information and send SMS messages through CloudContactAI.
- Create multiple forms with custom fields
- Embed forms on any page or post using shortcodes
- Send SMS messages to users who submit the form
- Customize SMS message templates
- Track form submissions
- View SMS delivery status
- WordPress 5.0 or higher
- PHP 7.2 or higher
- Composer (for development)
- CloudContactAI account with API credentials
- Download the plugin zip file
- Upload the plugin through the WordPress admin interface or extract to the
/wp-content/plugins/directory - Activate the plugin through the 'Plugins' menu in WordPress
- Go to 'CCAI Forms' > 'Settings' to configure your CloudContactAI API credentials
- Create forms and embed them on your site using shortcodes
- Clone the repository
git clone https://github.com/your-username/ccai-forms.git- Install dependencies
cd ccai-forms
composer install- Upload to your WordPress plugins directory or create a symlink
- Go to 'CCAI Forms' > 'Add New Form'
- Fill in the form details:
- Form Title: The title displayed on the form
- Form Name: A unique identifier for the form (used in shortcodes)
- Description: Optional description displayed above the form
- Success Message: Message displayed after successful submission
- SMS Template: The message template for SMS messages
Use the shortcode [ccai_form id="1"] or [ccai_form name="contact-form"] to embed a form on any page or post.
Additional shortcode attributes:
title: Override the form titledescription: Override the form descriptionbutton_text: Change the submit button textshow_title: Set to 'no' to hide the titleshow_description: Set to 'no' to hide the description
Example:
[ccai_form name="contact-form" button_text="Send Message" show_description="no"]
Go to 'CCAI Forms' > 'Submissions' to view all form submissions. You can filter submissions by form.
This plugin uses Composer for dependency management and follows PSR-4 autoloading standards.
ccai-forms/
├── admin/ # Admin-specific assets
│ ├── css/ # Admin CSS
│ ├── js/ # Admin JavaScript
│ └── partials/ # Admin templates
├── languages/ # Translations
├── public/ # Public-facing assets
│ ├── css/ # Public CSS
│ ├── js/ # Public JavaScript
│ └── partials/ # Public templates
├── src/ # PHP source code (PSR-4 autoloaded)
│ ├── Admin/ # Admin functionality
│ ├── Api/ # API integration
│ ├── Database/ # Database operations
│ ├── Form/ # Form management
│ ├── Frontend/ # Frontend functionality
│ ├── I18n.php # Internationalization
│ ├── Loader.php # Hook loader
│ └── Plugin.php # Main plugin class
├── tests/ # PHPUnit tests
│ ├── Api/ # API tests
│ ├── Form/ # Form tests
│ ├── Frontend/ # Frontend tests
│ ├── Admin/ # Admin tests
│ ├── Unit/ # Unit tests
│ ├── bootstrap.php # Test bootstrap
│ └── wp-functions.php # WordPress function mocks
├── vendor/ # Composer dependencies
├── ccai-forms.php # Main plugin file
├── composer.json # Composer configuration
├── phpunit.xml # PHPUnit configuration
├── LICENSE # MIT License
├── README.md # Plugin documentation
└── README.txt # WordPress.org readme
To run the PHPUnit tests:
composer testTo check code quality:
composer phpcsTo automatically fix code style issues:
composer phpcbfTo build the plugin for distribution:
- Install dependencies without dev packages
composer install --no-dev- Create a zip file excluding development files
zip -r ccai-forms.zip . -x "*.git*" "*.github*" "composer.json" "composer.lock" "phpcs.xml" "phpunit.xml" "*.md" "tests/*"This plugin is licensed under the MIT License. See the LICENSE file for details.
Copyright (c) 2025 CloudContactAI LLC