PHPackages                             flowcheckdnb-cpu/module-abandoned-cart - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Mail &amp; Notifications](/categories/mail)
4. /
5. flowcheckdnb-cpu/module-abandoned-cart

ActiveMagento2-module[Mail &amp; Notifications](/categories/mail)

flowcheckdnb-cpu/module-abandoned-cart
======================================

AI brand-voice abandoned-cart recovery emails for Magento 2 + Hyvä, powered by Google Gemini

v0.23.0(1mo ago)101OSL-3.0PHPPHP &gt;=8.3

Since May 28Pushed 1mo agoCompare

[ Source](https://github.com/flowcheckdnb-cpu/magento2-abandoned-cart)[ Packagist](https://packagist.org/packages/flowcheckdnb-cpu/module-abandoned-cart)[ RSS](/packages/flowcheckdnb-cpu-module-abandoned-cart/feed)WikiDiscussions main Synced 1w ago

READMEChangelogDependencies (14)Versions (30)Used By (0)

Magebit Abandoned Cart
======================

[](#magebit-abandoned-cart)

[![Latest Version](https://camo.githubusercontent.com/268262e050ed650cba540e63a3ddca9f9403e9cbf7140777e0a70daa3c5ca033/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f666c6f77636865636b646e622d6370752f6d6f64756c652d6162616e646f6e65642d636172742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/flowcheckdnb-cpu/module-abandoned-cart)[![License](https://camo.githubusercontent.com/829ae9ba803f4df1412caa9376020cf441e5726ba3b089d063a30f169429450e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f666c6f77636865636b646e622d6370752f6d6f64756c652d6162616e646f6e65642d636172742e7376673f7374796c653d666c61742d737175617265)](LICENSE)[![PHP Version](https://camo.githubusercontent.com/a8914078a873e9df313d0263f18ae34207ebcc45d160fcf039c2ddaea7b55093/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f666c6f77636865636b646e622d6370752f6d6f64756c652d6162616e646f6e65642d636172742e7376673f7374796c653d666c61742d737175617265)](composer.json)

AI brand-voice abandoned-cart recovery emails for Magento 2 + Hyvä, powered by Google Gemini.

Features
--------

[](#features)

- Cron-driven scanner that finds abandoned carts and dispatches recovery emails
- Per-stage AI-generated subject + preheader + body in your configured brand voice (via Google Gemini 2.5 Flash, free tier)
- Static-template fallback when the API is unavailable or unconfigured — pipeline never silently drops a customer
- Dedup-safe send log with `UNIQUE(quote_id, stage_key)`
- Per-store-view brand voice (name, voice description, tone, locale)
- Admin configuration tree under **Stores → Configuration → Magebit → Abandoned Cart**
- PHPStan level 9 + PHPCS (Magento2 / PSR-12 / Slevomat) clean

Status
------

[](#status)

**v0.13.0 — original plan complete (OOS filter + integration tests).**

Implemented:

- Three-stage abandoned-cart cadence: stage 1 reminder, stage 2 follow-up, stage 3 with auto-generated coupon
- **Low-stock urgency email** — separate cron, fires daily when any cart item drops to qty ≤ threshold but is still &gt; 0; carries its own coupon from a separate admin-selected rule
- AI generator (Google Gemini) + static template fallback per email type
- Cron-driven scanner with send-log dedup keyed on `(quote_id, stage_key)` — stage keys for low-stock embed the date so the unique constraint enforces a natural daily cap
- `CouponIssuer` mints unique codes from any admin-selected cart price rule (requires `use_auto_generation=1` on the rule)
- Generated coupon is rendered as a prominent banner AND mentioned naturally in AI body copy
- `sales_order_place_after` observer that suppresses future sends once the customer buys
- Token-signed recovery link in every email — restores the quote into the visitor's session and redirects to `/checkout/cart`
- API key redaction in error logs
- **One-click unsubscribe**: every email carries an unsubscribe link that flips the `unsubscribed` flag on every log row for the (customer\_email, store\_id) pair. Both finders consult that flag before yielding candidates.
- **Admin send-log grid** at *Marketing → Communications → Abandoned Cart Log* — filterable/sortable columns (Type, Recipient, Store, Status, AI?, Coupon, Recovered At, Unsubscribed?), CSV/Excel export, mass-delete and mass-mark-unrecovered actions.
- **Personalized coupon codes**: codes are prefixed with the customer's sanitized first name (or email local-part when no name is on file), e.g. `VERONICA-AB3F` instead of `0GK2IY2HCNVB`. Magento's coupon generator still guarantees uniqueness via the random suffix.
- **Product images + redesigned emails**: every email shows a cart-items grid (thumbnail · name · qty · line price) above the AI body copy. Card layout on a soft canvas, dashed coupon banner, primary CTA. Low-stock template gets a red urgency pill and red CTA.
- **Style rotation**: each send randomly picks one of 7 rhetorical approaches (curious question, vivid observation, playful, brief, scene-setting, friend-texting, direct statement) so the same customer reading stages 1/2/3 doesn't see the same "Hey {name}" pattern three times.
- **Admin test-send button** on the send-log grid. Dispatches one preview email of the selected type to any recipient using a synthetic sample cart — no coupon minted, no log row written.
- **Unit test suite** (26 tests, 57 assertions, ~20 ms) covering `MarkdownRenderer`, `StaticTemplateFallback`, `Gemini\ResponseParser`, and `CouponIssuer` (including all coupon-prefix sanitization edge cases).
- **Out-of-stock + disabled-product filter**: `AbandonedCartFinder` skips quotes whose items are all non-salable so customers aren't asked to recover empty carts.
- **Integration tests scaffolded** for `SendLogRepository` (4 tests: dedup constraint, stage-key separation, recovered flag, per-store unsubscribe). Run via `vendor/bin/phpunit -c dev/tests/integration/phpunit.xml.dist` once the Magento integration sandbox DB is configured.

Planned for v1.0.0+:

- Recovery-click tracking
- GDPR consent flow at checkout
- Customer-group targeting

Requirements
------------

[](#requirements)

- Magento Open Source / Commerce 2.4.8 or newer
- PHP 8.3+
- Google Gemini API key (free at [aistudio.google.com](https://aistudio.google.com)) — optional, falls back to static templates without one

Installation
------------

[](#installation)

```
composer require flowcheckdnb-cpu/module-abandoned-cart
bin/magento setup:upgrade
bin/magento setup:di:compile
bin/magento cache:clean
```

Configuration
-------------

[](#configuration)

**Stores → Configuration → Magebit → Abandoned Cart:**

GroupFieldsGeneralEnable module, sender identity, unsubscribe routeStagesPer-stage delay + email templateLow-stockThreshold, template, coupon rule, frequency cap (planned)Brand voiceBrand name, voice description, tone, localeGemini APIEncrypted API key, model selector, kill-switch, request timeoutThen ensure two `trans_email/ident_*/name` config rows are populated (Magento requires both `email` and `name` for sender identities) and run cron — either via the natural heartbeat or:

```
bin/magento cron:run --group=default
```

Verifying
---------

[](#verifying)

Backdate an active quote into the stage-1 window and force-run cron. The email should land at your configured SMTP destination (e.g. Mailpit in local development).

```
UPDATE quote SET is_active=1, updated_at=NOW() - INTERVAL 2 HOUR WHERE entity_id=...;
```

License
-------

[](#license)

OSL-3.0 — see [LICENSE](LICENSE).

###  Health Score

39

—

LowBetter than 84% of packages

Maintenance89

Actively maintained with recent releases

Popularity3

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

29

Last Release

56d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/288599866?v=4)[flowcheckdnb-cpu](/maintainers/flowcheckdnb-cpu)[@flowcheckdnb-cpu](https://github.com/flowcheckdnb-cpu)

---

Top Contributors

[![flowcheckdnb-cpu](https://avatars.githubusercontent.com/u/288599866?v=4)](https://github.com/flowcheckdnb-cpu "flowcheckdnb-cpu (33 commits)")

---

Tags

aiemailmagentoabandoned cartGeminimagento2recoveryhyvamagebit

### Embed Badge

![Health badge](/badges/flowcheckdnb-cpu-module-abandoned-cart/health.svg)

```
[![Health](https://phpackages.com/badges/flowcheckdnb-cpu-module-abandoned-cart/health.svg)](https://phpackages.com/packages/flowcheckdnb-cpu-module-abandoned-cart)
```

###  Alternatives

[mollie/magento2

Mollie Payment Module for Magento 2

1131.9M16](/packages/mollie-magento2)[buckaroo/magento2

Buckaroo Magento 2 extension

32420.3k8](/packages/buckaroo-magento2)[dotdigital/dotdigital-magento2-extension

Dotdigital for Magento 2

50398.5k20](/packages/dotdigital-dotdigital-magento2-extension)[run-as-root/magento2-prometheus-exporter

Magento2 Prometheus Exporter

68357.9k](/packages/run-as-root-magento2-prometheus-exporter)[loki/magento2-components

Core module for defining Alpine.js components with advanced AJAX features

1011.8k26](/packages/loki-magento2-components)[yireo/magento2-emailtester2

Preview transactional emails and test send them in your backend

34431.0k](/packages/yireo-magento2-emailtester2)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
