Templates

Magento Abandoned Cart Recovery

Customer abandons their cart. An hour later, this workflow asks Magento whether they came back on their own. If they did, nothing is sent. If they did not, they receive a recovery email with cart contents and a one-click checkout link.

12 minutes setupUpdated 2026-05-21

Overview

Many abandoned cart emails run on a fixed timer without checking whether the order completed. That can send reminders for purchases already finished, which hurts customer experience and sender reputation.

This workflow checks Magento first. One hour after abandonment, it asks whether the cart is still active. If the customer returned and completed checkout, the workflow exits. If not, Resend sends a recovery email with cart items and a checkout link.

The flow

The trigger provides email, name, cart ID, items, and total. A script formats items as an HTML list for the email body, then the workflow waits one hour.

After the wait, it authenticates with Magento, fetches the cart by ID, and checks three conditions: API 404, is_active false, or items_count zero. Any of those means the cart is done and the workflow exits. Otherwise Resend sends the recovery email.

Steps

  • JavaScript (map_input): Validates the payload and pre-renders cart items as HTML for the email step.
  • Wait (wait_1_hour): One hour delay before follow-up.
  • HTTP (get_magento_token): Authenticates with the Magento admin API.
  • HTTP (check_cart_status): Fetches the cart by ID with includeFullResponseString enabled so status codes are available.
  • JavaScript (evaluate_cart_state): Treats non-200 responses, is_active: false, or items_count: 0 as recovered/completed.
  • Switch (cart_recovery_branch): Recovered carts exit. Abandoned carts continue to email.
  • Resend (resend_abandoned_cart_1): Recovery email with items, total, and checkout button.

Why the Magento check matters

Sending after one hour without a status check is simpler, but a meaningful share of customers may already have checked out. Those customers receive unnecessary "you left items behind" emails.

The extra API calls reduce mistaken sends and help protect unsubscribe rates and sender reputation.

Setup

  1. Set magento_base_url in workflow variables (e.g. https://yourstore.com).
  2. Add magento_admin_username and magento_admin_password to secrets.
  3. Connect Resend and replace the from address with your verified sender.
  4. Wire the trigger to your cart abandonment event. Most stores expose a JS hook or backend event. Payload needs email, firstName, cartId, cartTotal, cartCurrency, cartUrl, and cartItems (array of {name, qty, price}).

Worth knowing

Magento API behavior for completed carts can vary by version and configuration. This evaluator covers common cases. For custom setups, verify what your install returns after order conversion and adjust conditions if needed.

Adapt this template in Unmeshed

Start from the sequence above, then connect your APIs, approvals, decision logic, and notifications as durable workflow steps.