A Craft CMS plugin that integrates Verbb's Formie with SAP Cloud Platform, enabling automatic submission of form data using SAP's dynamic schema format with OAuth 2.0 authentication.
This plugin is currently in active development and provided under the MIT License for testing purposes.
Licensing is subject to change. We are finalizing our licensing structure and some or all features may require a paid license when officially released on the Craft Plugin Store. Some plugins may remain free, others may offer free and Pro editions, or be fully commercial.
If you are using this plugin, please be aware that future versions may have different licensing terms.
- Craft CMS 5.0 or greater
- PHP 8.2 or greater
- Formie 3.0 or greater
- OAuth 2.0 Authentication - Secure authentication with SAP Cloud Platform
- Dynamic Schema Support - Sends form data in SAP's flexible JSON format
- Multi-Environment - Supports both staging and production environments
- Metadata Tracking - Automatically captures IP, user agent, UTM parameters, and more
- Field Mapping - Intelligent handling of all Formie field types
- Environment Variables - Secure credential management with autosuggest
- Header Field Mapping - Configure memberID, memberEmail, memberMobile, invoiceID
cd /path/to/projectcomposer require lindemannrock/craft-formie-sap-integration./craft plugin/install formie-sap-integrationcd /path/to/projectddev composer require lindemannrock/craft-formie-sap-integrationddev craft plugin/install formie-sap-integrationIn the Control Panel, go to Settings → Plugins and click "Install" for Formie SAP Integration.
Add these to your .env file:
# Required OAuth credentials
SAP_CLIENT_ID=your_client_id_here
SAP_CLIENT_SECRET=your_client_secret_here
# Environment selection
SAP_ENVIRONMENT=staging
# Optional API URLs (can be configured in CP)
SAP_STAGING_URL=https://staging-api.sap.com/v1
SAP_PRODUCTION_URL=https://production-api.sap.com/v1
SAP_API_ENDPOINT=/customer-feedback
# Optional OAuth URLs
SAP_OAUTH_TOKEN_URL=https://api.sap.com/oauth/token
SAP_OAUTH_AUTHORIZE_URL=https://api.sap.com/oauth/authorize
SAP_OAUTH_SCOPE=customer_data:write,forms:submit-
Go to Formie → Settings → Integrations
-
Click New Integration and select SAP Cloud under CRM
-
Configure the integration:
- Name: Give your integration a name (e.g., "SAP Production")
- Client ID: Enter
$SAP_CLIENT_ID(environment variable tip will appear) - Client Secret: Enter
$SAP_CLIENT_SECRET - Environment: Enter
$SAP_ENVIRONMENTor choose staging/production - API URLs: Configure or use environment variables
- API Endpoint: Set to
/customer-feedbackor as provided by SAP - OAuth URLs: Configure or use environment variables
-
Save the integration
-
Test the connection using the Refresh button
- Edit your Formie form
- Go to Integrations tab
- Enable the SAP Cloud integration
- Configure header field mapping:
- Member ID Field: Map to your member ID field
- Member Email Field: Map to your email field
- Member Mobile Field: Map to your phone field
- Invoice ID Field: Map to invoice/order field (if applicable)
- Save the form
The integration sends data in SAP's dynamic schema format:
{
"header": {
"memberID": "MTIzNDU2", // Base64 encoded
"memberEmail": "dXNlckBleGFtcGxlLmNvbQ==", // Base64 encoded
"memberMobile": "Kzk2NjEyMzQ1Njc4OQ==", // Base64 encoded
"invoiceID": "INV-2025-001"
},
"submissionId": "12345",
"formId": "contact_form",
"formTitle": "Contact Form",
"submissionDate": "2025-07-10T14:30:00.000Z",
"metadata": {
"ipAddress": "192.168.1.100",
"userAgent": "Mozilla/5.0...",
"referrer": "https://example.com",
"language": "ar",
"timezone": "Asia/Riyadh",
"deviceType": "mobile",
"utmSource": "google",
"utmMedium": "cpc",
"utmCampaign": "summer_2025"
},
"fields": [
{
"handle": "customer_name",
"label": "Customer Name",
"value": "أحمد محمد"
},
{
"handle": "satisfaction_rating",
"label": "How satisfied are you?",
"value": 5
}
]
}Always included:
- Submission ID, Form ID, Form Title, Submission Date
- IP Address, User Agent, Language, Timezone
- Device Type (mobile/tablet/desktop)
- Submission URL
Included when available:
- Referrer URL
- UTM parameters (source, medium, campaign, content, term)
- Text/Textarea → String values
- Number → Numeric values
- Dropdown/Radio → Selected value
- Checkboxes → Array of selected values
- Date → ISO 8601 format
- Name → Combined first/last name
- Phone → Extracted phone number
- Email → Email address
- Rating → Numeric rating value
- File Uploads → Not included in SAP payload
See SAP_API_TEST_GUIDE.md for comprehensive testing instructions.
-
Test Connection
- Save the integration and click Refresh
- Check for connection success/error messages
-
Test Form Submission
- Create a simple test form
- Enable SAP integration
- Submit the form
- Check Formie's integration logs
- Ensure plugin is installed:
php craft plugin/list | grep formie-sap-integration - Clear all caches:
php craft clear-caches/all - Check plugin is enabled in Settings → Plugins
- Verify Client ID and Secret are correct
- Check OAuth URLs are accessible
- Ensure redirect URI is whitelisted in SAP console
- Verify environment variables are set correctly
- Check API endpoint is correct
- Verify all required header fields are mapped
- Review Craft logs for detailed error messages
- Ensure SAP API is accessible from your server
- Verify you're using
autosuggestFieldin templates - Check both
suggestEnvVars: trueandsuggestAliases: trueare set - Clear compiled templates:
php craft clear-caches/compiled-templates
- README.md - This overview and setup guide
- SAP_API_TEST_GUIDE.md - Comprehensive API testing guide
- TODO.md - Development tasks and future improvements
- .env.example - Environment variable examples
- Documentation: https://github.com/LindemannRock/craft-formie-sap-integration
- Issues: https://github.com/LindemannRock/craft-formie-sap-integration/issues
- Email: support@lindemannrock.com
This plugin is licensed under the MIT License. See LICENSE for details.
Developed by LindemannRock
Built for use with Formie by Verbb