WP Manifestindependent plugin directory
manifest / builders / bricks-mailerlite

Bricks MailerLite

WordPress plugin: MailerLite subscriber integration for Bricks Builder forms

★ 0stars

Install

Download source zip No release zip yet

This is the repository archive. It installs, but the folder name will carry the branch suffix and updates will not flow.

Install straight from GitHub with WP-CLI:

wp plugin install https://github.com/izsog/bricks-mailerlite/archive/refs/heads/main.zip
No built-in updater. New versions won't appear under Dashboard → Updates. Install new releases yourself, or let Git Updater track the repository.

WordPress 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

Installation

  1. Download or clone this repository
  2. Upload the bricks-mailerlite folder to /wp-content/plugins/
  3. Activate the plugin in WordPress

Setup

1. API Key

  1. Go to Settings > Bricks MailerLite
  2. Enter your MailerLite API key (found in MailerLite under Integrations > API)
  3. Click "Ellenőrzés és mentés" (Verify and save)
  4. On success, your groups and subscriber fields are fetched and cached

2. Bricks Form Configuration

  1. Edit a page with Bricks Builder
  2. Add or select a Form element
  3. In the Actions setting, add "MailerLite feliratkozás"
  4. 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)
  5. 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_options capability 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 curl directly instead of wp_remote_get/post because MailerLite's WAF blocks the default WordPress User-Agent on certain endpoints (e.g., /groups)
  • Groups and subscriber fields are cached in wp_options after API key verification — click "Frissítés" (Refresh) in the admin to update
  • Bricks map_fields => true populates field selects with form field IDs automatically

License

GPLv2 or later