Personalized abandoned-cart recovery emails for Adobe Commerce
Every four hours, spot shoppers who left items behind in Adobe Commerce and send them a friendly, personalized recovery email through Gmail.
Every 4 hours, run an abandoned-cart recovery pass for my Adobe Commerce (Magento) store and send personalized recovery emails through Gmail.
Step 1 — find abandoned carts. Call Adobe Commerce Search Carts with a searchCriteria filter that requires all of: is_active eq true, items_count gt 0, and updated_at between (now minus 48 hours) and (now minus 2 hours). Page through until you have every match. Skip any cart where customer_id is null (guest carts have no email to reach).
Step 2 — resolve the shopper. For each cart, call Adobe Commerce Search Customers with a searchCriteria filter of entity_id eq {cart.customer_id} to pull the customer's firstname, lastname, and email. If the customer record is missing an email or the account is disabled, skip that cart.
Step 3 — dedupe. Keep a small internal record of (cart_id, customer_email, sent_at) for every message you send. At the start of each run, drop any cart whose id already appears in that record with sent_at within the last 24 hours. This is the guard against nagging the same shopper twice in one day.
Step 4 — draft the email. For every remaining cart, read the cart's items array to get product names and quantities, then draft a short, friendly recovery email (roughly 80–130 words) that: greets the shopper by first name, references 1–3 specific items they left behind by name and quantity, matches the tone of a specialty retailer (warm, human, lightly enthusiastic, never pushy or discount-desperate), and closes with a single clear call-to-action link back to the store cart. No emoji-spam, no urgency scare-copy, no fake scarcity.
Step 5 — send. For each drafted email, call Gmail Send a Message with the customer's email in To, a subject line that references what they left behind (e.g. "Your [product] is still in your cart"), and the AI-written body. After a successful send, append (cart_id, customer_email, sent_at) to the internal record used in step 3.
At the end of the run, report: how many carts were found in the window, how many were skipped because they were guest carts, missing an email, or already emailed in the last 24 hours, and how many recovery emails were sent.
Additional information
What does this prompt do?
- Checks Adobe Commerce (Magento) every four hours for active carts that still have items and have not been touched for at least two hours (up to two days).
- Looks up each shopper's name and email inside Adobe Commerce so the message goes to a real customer, not a guest ghost.
- Uses AI to write a short, warm recovery email that names the exact products left in the cart and matches the tone of a specialty retailer.
- Sends the email through your Gmail account with a single link back to the store, and remembers who was contacted so nobody gets the same nudge twice in 24 hours.
What do I need to use this?
- An Adobe Commerce (Magento) store you can create an admin integration token in
- A Gmail account you're happy to send recovery messages from
- The web address of the store page you want customers to land on when they click through
How can I customize it?
- Change how often it runs (four hours is a starting point; hourly works for high-traffic stores)
- Adjust the abandonment window (default: carts idle between two and 48 hours) to fit your buying cycle
- Rewrite the brand voice guidance the AI follows so the emails sound like your store
- Swap the call-to-action link, add a discount code, or attach a support contact for higher-value carts
Frequently asked questions
Does Adobe Commerce send abandoned-cart emails on its own?
Will guest checkouts get emailed?
How does it avoid spamming the same shopper?
Can I add a discount code to the email?
Do the emails look automated?
Related templates
Recover the sales your Magento store is quietly losing.
Turn on personalized abandoned-cart recovery without paying for another marketplace extension.