Bricks MailerLite
WordPress plugin: MailerLite subscriber integration for Bricks Builder forms
★ 0stars
0forks
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/izsog/bricks-mailerlite/archive/refs/heads/main.zipWordPress plugin that adds MailerLite subscriber integration to Bricks Builder forms.
Features
- Bricks form action — "MailerLite feliratkozás" action available in the Bricks form element
- Group selection — choose which MailerLite group subscribers are added to (dropdown in Bricks editor)
- Dynamic field mapping — MailerLite fields (name, last_name, company, phone, custom fields) are fetched from the API and appear as select controls in the Bricks form editor
- Encrypted API key — stored with AES-256-CBC encryption in the database, never exposed in HTML
- Admin dashboard — Settings > Bricks MailerLite page for API key management, group overview, and field reference
- Click-to-copy group IDs — easily copy group IDs from the admin page
Requirements
- WordPress 6.0+
- PHP 7.4+ with
curlandopensslextensions - Bricks Builder 1.12.2+
- MailerLite account with API key
Installation
- Download or clone this repository
- Upload the
bricks-mailerlitefolder to/wp-content/plugins/ - Activate the plugin in WordPress
Setup
1. API Key
- Go to Settings > Bricks MailerLite
- Enter your MailerLite API key (found in MailerLite under Integrations > API)
- Click "Ellenőrzés és mentés" (Verify and save)
- On success, your groups and subscriber fields are fetched and cached
2. Bricks Form Configuration
- Edit a page with Bricks Builder
- Add or select a Form element
- In the Actions setting, add "MailerLite feliratkozás"
- A MailerLite control group appears with:
- Csoport (Group) — select which MailerLite group the subscriber joins
- Email mező (Email field) — map to the form field containing the email address (required)
- Additional fields (Name, Last Name, etc.) — map to corresponding form fields (optional)
- Save and publish
How It Works
Form Submit → Bricks fires "mailerlite" action → Plugin reads settings
→ Maps form fields to MailerLite fields
→ Calls MailerLite API (POST /api/subscribers)
→ Returns success/error message to the form
Architecture
bricks-mailerlite/
├── bricks-mailerlite.php # Plugin bootstrap
├── includes/
│ ├── class-crypto.php # AES-256-CBC encrypt/decrypt
│ ├── class-mailerlite-api.php # MailerLite API wrapper (curl)
│ ├── class-admin-page.php # Settings page
│ ├── class-ajax-handler.php # AJAX endpoints (verify key, refresh groups)
│ └── class-bricks-action.php # Bricks form action + controls
└── assets/
├── css/admin.css # Admin page styles
└── js/admin.js # Admin AJAX logic
Security
- API key encrypted at rest using AES-256-CBC with a key derived from
wp_salt('auth') - Nonce verification on all AJAX requests
manage_optionscapability check on admin actions- Input sanitization (
sanitize_text_field,sanitize_email,is_email) - Output escaping (
esc_html,esc_attr) - ABSPATH check on every PHP file
Technical Notes
- Uses
curldirectly instead ofwp_remote_get/postbecause MailerLite's WAF blocks the default WordPress User-Agent on certain endpoints (e.g.,/groups) - Groups and subscriber fields are cached in
wp_optionsafter API key verification — click "Frissítés" (Refresh) in the admin to update - Bricks
map_fields => truepopulates field selects with form field IDs automatically
License
GPLv2 or later