Skip to content

feat(mailerlite): set subscriber status and resubscribe from the field map - #359

Open
matiasqueroceballos wants to merge 1 commit into
trunkfrom
fix/mailerlite-subscriber-status
Open

matiasqueroceballos wants to merge 1 commit into
trunkfrom
fix/mailerlite-subscriber-status

Conversation

@matiasqueroceballos

@matiasqueroceballos matiasqueroceballos commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Support thread: https://wordpress.org/support/topic/mailerlite-subscriber-status-unconfirmed/

Some signups sent to MailerLite Classic end up as Unconfirmed. The plugin only sent email and fields, so MailerLite decided the status (the account's double opt-in setting). There was no way to force it.

Change

All inside CRMLIB_Mailerlite, so it works for every form integration without touching common code.

  • The field map now offers two virtual fields: Subscriber status (active, unconfirmed, unsubscribed) and Resubscribe (true/false). They are set with a fixed value (Add Custom Value / Custom value).
  • type and resubscribe are sent at the top level of the payload, as the Classic API documents for POST /groups/{id}/subscribers.
  • Nothing is sent unless mapped, so existing feeds behave as before. Invalid values are ignored.
  • New filter formscrm_mailerlite_subscriber to change the payload.
  • Field names are prefixed (formscrm_subscriber_*) so they never collide with MailerLite custom field keys.

Not covered

  • The "Invalid sign-up date" Unconfirmed cases from the thread. The group endpoint does not accept a sign-up date. Forcing active probably avoids them, but that is untested.

Testing

  • PHPCS clean.
  • Added tests/Unit/test-mailerlite.php (payload unchanged without options, top-level type/resubscribe, invalid values ignored, filter, field map). Not run locally (no MySQL/test-lib); relying on CI.
  • Manual check against a MailerLite Classic account with double opt-in for API enabled.

🤖 Generated with Claude Code

Open WordPress Playground Preview

@chatgpt-codex-connector

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-26T08:11:48.515639Z
We couldn’t complete this review. Comment @codex review to try again.
7785c61 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Credits must be used to enable repository wide code reviews.

Signups sent to MailerLite Classic could end up Unconfirmed because no
`type` was sent and the account's double opt-in decided. The group
endpoint accepts `type` and `resubscribe`, so expose them as virtual
fields in the field map, set with a fixed value ("Add Custom Value").

Nothing is sent unless mapped, so existing feeds are unchanged. Invalid
values are ignored. Logic stays inside CRMLIB_Mailerlite, so every form
integration gets it. Adds the formscrm_mailerlite_subscriber filter.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@matiasqueroceballos
matiasqueroceballos force-pushed the fix/mailerlite-subscriber-status branch from 7785c61 to 5992e1f Compare November 26, 2026 08:18
@github-actions

Copy link
Copy Markdown

✅ WordPress Plugin Check Report

✅ Status: Passed

📊 Report

All checks passed! No errors or warnings found.


🤖 Generated by WordPress Plugin Check Action • Learn more about Plugin Check

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants