Problem/Motivation
Now that we have
- User registration
- Webform
- Commerce
integration for Brevo Newsletter subscription, I'm unsure if it would also make sense to provide Block Plugin for newsletter subscription.
Maybe we should also provide a central page in the main module, which the submodules can refer to for unsubscribing from the newsletter?
First the benefits and downsides surely should be discussed for both. Currently we're using the HTML forms from Brevo in these cases, which is quite flexible but also has downsides compared to a more deep Drupal integration. I'm a bit biased. What do the other maintainers think?
If there's anything implemented duplicate in the three submodules, we should use this change to move that into a helper service maybe, which can then also be used on the Block plugin?
Comments
Comment #10
renrhafMerged to 1.0.x.
Adds:
- A newsletter subscription Block (BrevoNewsletterBlock) placeable on any page, with list selection, optional double opt-in and a configurable success message.
- A signed-token unsubscribe controller at /brevo/unsubscribe (HMAC token so links are safe in marketing emails), backed by ContactsApiClientHelper::unsubscribeContact().
- A shared SubscriptionManager service (brevo.subscription_manager) that centralises the subscribe logic (direct/queue via the existing Brevo events, double opt-in, attributes) and is now reused by the webform handler and the user-registration integration, removing the previous duplication.
Covered by kernel + functional tests; CI green.
Comment #12
anybody@renrhaf you're crazy (with AI I guess xD)
THANKS!
Comment #13
renrhafYou're welcome ! And yes I've started using Claude Code for my open source work, with a closed loop for testing on a Drupal11 fresh install
I will also test everything properly of course on top of that before creating a new release
It works very well and it's a good way to find enough time to make good progress on this module
Comment #14
anybodyYeah perfect results!
BTW I saw this nice template here for the AI usage checks: https://www.drupal.org/project/canvas_override/issues/3590567
You might like it, where it makes sense? No idea if it's a new community standard.
Comment #15
renrhafThanks for the information, I've updated my Claude guidelines to be fully transparent about the whole process !