commerce_cart_reminder
The Commerce Cart Reminder module for Drupal 10/11 helps recover potentially lost sales by automatically sending reminder emails to customers who add items to their cart but leave the site without completing their purchase. These emails include a secure, personalized link that lets customers return and restore their cart exactly as they left it—no need to re-add products manually. This effortless experience makes it easy for them to continue shopping from where they left off, significantly increasing the likelihood of completing the sale. It also allows admins to generate secure, shareable referral links from past orders. Customers can share these links with others, and anyone who clicks them will have the exact items from that order automatically added to their cart, then continue browsing and add additional items as needed, making reorders, referrals and bundled promotions quick, easy, and effective.
Key Features
- Automated Reminders: Configurable time delay for sending reminder emails after a cart is abandoned.
- Customizable Email Content with Editor: Easily set the subject and body of the reminder emails using a rich text editor. This allows for flexible and visually appealing email templates.
- Token Support: Personalize emails with tokens like
[user:name],[user:mail], and a secure[cart:link]to bring customers back to their carts. - Seamless Cart Restoration from Email: Users can click a secure link in the reminder email to restore their cart on any browser or device.
- For Anonymous Users: If an anonymous user clicks the cart restoration link, they will be prompted to enter their contact details (e.g., email address) before their cart is restored, ensuring you capture their information for future engagement.
- For Logged-in Users: If a logged-in user clicks the cart restoration link, it automatically adds the original order items back to the cart.
- BCC/CC Options: Send copies of reminder emails to administrative addresses for monitoring purposes.
- Test Mode: Divert all reminder emails to a specified test address for safe testing without impacting live customers.
- Bulk Operations: Enable bulk sending of reminders to multiple carts from the Commerce order listing page.
- Resend Reminders: Option to resend reminders to carts that have already received one during bulk operations.
- Automated Cart Deletion: Configure a timeframe after which old, abandoned carts are automatically deleted to keep your database clean.
- Secure Cart Links: Generates unique and secure links for customers to seamlessly return to their abandoned carts.
-
Cart Referral Link Generation: Generate a secure referral link from the order details page. Admins can:
- Copy and share the link manually with users (e.g., via email or chat) or embedded in emails and order confirmation pages.
- Customers can also share their link with friends or others—anyone who clicks it will have the same items automatically added to their cart that saves time by quickly reorder or pre-filling their cart with previous items.
- Ideal for reorders, referrals, or promoting product bundles.
You can generate a secure cart referral link from any order using the service method:
$service = \Drupal::service('commerce_cart_reminder.service'); $referral_link = $service->generateCartLink($order);
Installation
- Download the module:
composer require 'drupal/commerce_cart_reminder:^1.0'(Replace
^1.0with the appropriate version if different) - Enable the module:
drush en commerce_cart_reminderOr enable it through the Drupal admin interface (
/admin/modules).
Configuration
After enabling the module, you can configure its settings at:
/admin/config/commerce/cart-reminder/settings
Available settings:
- Enable Cart Reminder: Turn the feature on or off globally.
- Send reminder after (hours): Define how many hours after a cart is created an email should be sent.
- Email subject: Customize the subject line of the reminder email.
- Email body: Craft the email content using a rich text editor. Available tokens:
[user:name],[user:mail],[cart:link]. - Send BCC / BCC email address: Enable and set an email address for Blind Carbon Copies.
- Send CC / CC email address: Enable and set an email address for Carbon Copies.
- Test mode / Test mode email address: Enable to send all reminder emails to a specific address for testing.
- Enable Bulk Send Reminders: Allows sending reminders via bulk operations on the cart listing page.
- Resend reminders if already sent: If bulk operations are enabled, this allows resending reminders to carts that previously received one.
- Delete cart after (hours): Set the time after which abandoned carts are automatically deleted. Set to
0to disable.
USAGE:
-
Automated Reminders:
Once configured and enabled, the module will automatically send reminder emails based on the "Send reminder after" setting. This typically happens via cron runs.
-
Bulk Send Reminders:
If "Enable Bulk Send Reminders" is active, navigate to the Commerce cart listing page (
/admin/commerce/orders/carts). You can select multiple abandoned carts and use the "Send Reminder" bulk operation to send emails to them. -
Database Cleanup:
The module automatically cleans up your database by deleting old, abandoned carts based on the "Delete cart after (hours)" setting during cron runs, helping maintain database performance and reduce clutter.
- Cart Referral Link Generation: Admins can generate and share a secure referral link from the order details page or generate programmatically and embed it in emails and order confirmations. Customers can also share the link with others, allowing anyone who clicks it to automatically add the same items to their cart—making reordering and referrals quick and easy.
TECHNICAL DETAILS:
- Service:
commerce_cart_reminder.cart_reminder_serviceorchestrates the core logic, including sending emails, generating secure links, and performing cleanup. - Configuration: Settings are stored in
commerce_cart_reminder.settings. - Database Table: A custom database table (
commerce_cart_reminder) is used to track which carts have already received a reminder to prevent duplicates. - Cron Integration: The module integrates with Drupal's cron system to periodically check for abandoned carts and send reminders/delete old carts.
For support, please post bug reports, feature requests and support requests to
the Commerce Cart Reminder issue queue. If you met any problems with this module - feel free to create an issue.
Alternative Solutions