feat: add Sender (sender.net) email marketing integration#177
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces a new integration for Sender (sender.net), adding backend PHP controllers, helpers, and routes, alongside frontend React components for authorization, field mapping, and action configuration. A critical issue was identified in RecordApiHelper.php where a potential WP_Error response is accessed as an array without validation, which can lead to a fatal error in PHP 8.0+.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| break; | ||
| } | ||
|
|
||
| $responseType = isset($response['success']) && $response['success'] ? 'success' : 'error'; |
There was a problem hiding this comment.
In PHP 8.0+, accessing a WP_Error object as an array (e.g., $response['success']) will trigger a fatal error. Since Hooks::apply can return a WP_Error object, you must validate the response using is_wp_error() before attempting array access.
$responseType = !is_wp_error($response) && isset($response['success']) && $response['success'] ? 'success' : 'error';References
- In PHP, when handling responses that may return a WP_Error object, always use the
is_wp_error()function to validate the response before accessing it as an array or object. This prevents fatal errors in PHP 8.0+.
There was a problem hiding this comment.
Good catch — verified on PHP 8.4 that isset($wpError['success']) throws Error: Cannot use object of type WP_Error as array, so this was a real fatal risk when the Pro hook returns a WP_Error. Added an is_wp_error() guard:
$responseType = !is_wp_error($response) && isset($response['success']) && $response['success'] ? 'success' : 'error';
🔍 WordPress Plugin Check Report
📊 Report
|
| 📍 Line | 🔖 Check | 💬 Message |
|---|---|---|
0 |
mismatched_plugin_name | Plugin name "Bit integrations - Form Integration, Webhook, Spreadsheets, CRM, LMS & Email Automation" is different from the name declared in plugin header "Bit Integrations". |
🤖 Generated by WordPress Plugin Check Action • Learn more about Plugin Check
Description
Adds a new Sender (sender.net) action integration. Users can connect a Sender account with an API token and push trigger data into Sender as subscriber and group operations. The free plugin handles authorization, group/custom-field fetching, and field mapping; the actual API calls are delegated to Bit Integrations Pro via hooks.
Motivation & Context
Extends the available email-marketing destinations so users can automate subscriber and group management in Sender directly from any Bit Integrations trigger.
Type of Change
Key Changes
Integrations (Backend)
SenderController— API-token authorization (verified against the/groupsendpoint),refreshGroupsandrefreshFieldsAJAX handlers, and the Flowexecute()entry point.RecordApiHelper— builds request data from the field map and routes each of the 9 actions to Pro viaHooks::apply(), with success/error logging throughLogHandler.Routes.php— registers the auth/refresh AJAX endpoints.{{slug}}tokens to{$slug}personalization form and excludes default fields (email/firstname/lastname/phone) from custom-field mapping.Supported Actions
Frontend
Sender.jsx,SenderAuthorization.jsx,SenderActions.jsx,SenderIntegLayout.jsx,SenderFieldMap.jsx,EditSender.jsx,SenderCommonFunc.js,staticData.js.NewInteg.jsx,EditInteg.jsx,IntegInfo.jsx,SelectAction.jsx, plus tutorial link andsender.webpicon.Checklist
Changelog