Skip to content

1.19.4 (2/5): Send newsletter signups to FluentCRM - #1054

Open
williamsba wants to merge 1 commit into
feature/1194-pro-promotionsfrom
feature/1194-newsletter-fluentcrm
Open

williamsba wants to merge 1 commit into
feature/1194-pro-promotionsfrom
feature/1194-newsletter-fluentcrm

Conversation

@williamsba

Copy link
Copy Markdown
Member

Second of five stacked PRs for 1.19.4. Based on the Pro promotion PR.

What changes

  • EmailOctopus is gone: its embed form, its remote script and stylesheet, and its reCAPTCHA key. No third-party assets load in the admin.
  • Signups go to the FluentCRM webhook on pluginize.com, server to server. Double opt-in is on in FluentCRM.
  • Only the typed email address is sent, and only when Subscribe is clicked.
  • Protections: nonce, capability check, honeypot field and a one-minute per-user rate limit. A FluentCRM reply with success: false is treated as an error.
  • JavaScript submits in place, with an admin-post.php fallback when JavaScript is off.
  • The form hides for a user after they subscribe.
  • Test webhooks: CPTUI_NEWSLETTER_ENDPOINT or the cptui_newsletter_endpoint filter can point at one.
  • Readme "External services" section (WordPress.org requirement) and suggested text for Settings → Privacy → Policy Guide.

Testing

  • Subscribe from the add/edit sidebar and the About page. Confirm the contact arrives in FluentCRM and the confirmation email is sent.
  • Submit twice within a minute and confirm "Please wait a minute".
  • To show the form again: wp user meta delete <user> cptui_newsletter_subscribed.

🤖 Generated with Claude Code

Replace the EmailOctopus embed with a server-side signup to the FluentCRM
webhook. No third-party scripts or styles load in the admin anymore.

- Only the typed email address is sent, and only when Subscribe is clicked.
- Nonce, capability check, honeypot field and a one-minute rate limit.
- Submits in place with JavaScript, falls back to a normal form post.
- The form hides for a user after they subscribe.
- CPTUI_NEWSLETTER_ENDPOINT or the cptui_newsletter_endpoint filter can point
  at a test webhook.
- Readme "External services" section and suggested privacy policy text.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

1 participant