On this page
Who counts as lapsed in a win-back campaign by API
“Lapsed” depends on how often a customer normally comes back. These are the lapse points the industry pages on this site use:
| Business | Lapsed means | What the card names |
|---|---|---|
| Online store | No order in 60 days | The last product |
| Restaurant | A regular gone 60 days | Their usual dish |
| Groomer or kennel | No booking in four months | The pet |
| Cleaning company | A canceled plan, or 60 days without a clean | A return offer |
| Gym | 30 days after a membership ends | Their favorite class |
| Auto repair shop | No visit in a year | Their vehicle |
| Software subscription | A canceled subscription | What shipped since they left |
If you know each customer’s own usual gap between orders or visits, use that instead of one number for everyone.
When to send a win-back card by API
- After email has had its turn. A customer who has gone quiet has often stopped opening your email; the card reaches them somewhere they still look.
- Once per lapse. Record which lapse each card was for, so nobody gets the same card twice and a customer who returns and lapses again can get one later.
- Not to people who came back on their own. The win-back template is meant only for customers who haven’t returned, so check for a new order the day you send.
- As a monthly or nightly batch, rather than one big blast, so each card lands close to the customer’s own lapse date.
What a win-back card says, with API merge fields
frontfirst_name
backlast_productpromo_codeMailr’s win-back template is a 6x11 card with three fields: the first name (up to 14 characters), the last product (22) and a promo code (12). Naming what they bought is what makes it read as a note to them rather than an ad. Keep the offer simple and give it an end date. More on which fields to use is in personalized direct mail.
How to measure a win-back campaign sent by API
- A code per customer. Count the codes used at checkout. Making one-use codes in bulk is covered in coupon mailers.
- A group you don’t mail. Leave a random tenth out and see how many of them order again anyway. The difference between the two groups is what the card did. The same split with two designs is in direct mail campaign.
- A window. Decide in advance how long after the card a return counts, and stick to it.
Code: a nightly win-back job by API
This picks customers past 60 days, skips anyone already mailed for this lapse, holds out a tenth, and sends the rest as 6x11 win-back cards with a code of their own:
# Nightly. customers.csv: id, name, first_name, line1, line2, city, state, zip, last_order (YYYY-MM-DD), last_product
# winback_mailed.csv: id, last_order the card was sent for (one card per lapse; this script appends to it)
import csv, datetime, os, random, requests
LAPSE = 60 # days without an order before a customer counts as lapsed
HOLDOUT = 0.1 # leave 10% out, to see how many come back without a card
today = datetime.date.today()
mailed = set()
if os.path.exists("winback_mailed.csv"):
with open("winback_mailed.csv", newline="") as f:
mailed = {(r[0], r[1]) for r in csv.reader(f)}
send, held = [], []
with open("customers.csv", newline="") as f:
for c in csv.DictReader(f):
days = (today - datetime.date.fromisoformat(c["last_order"])).days
if days < LAPSE or (c["id"], c["last_order"]) in mailed: # not lapsed yet, or already mailed for this lapse
continue
(held if random.random() < HOLDOUT else send).append(c)
for n, start in enumerate(range(0, len(send), 1000)):
chunk = send[start:start + 1000]
r = requests.post("https://api.mailr.dev/v1/batches", timeout=60,
headers={"Authorization": f"Bearer {os.environ['MAILR_API_KEY']}",
"Idempotency-Key": f"winback-{today.isoformat()}-{n}"},
json={"kind": "postcard", "size": "6x11", "template": "tmpl_winback", "verify": True,
"recipients": [{"to": {"name": c["name"][:40], "line1": c["line1"], "line2": c["line2"] or None,
"city": c["city"], "state": c["state"], "zip": c["zip"]},
"merge": {"first_name": (c["first_name"] or "Neighbor")[:14],
"last_product": (c["last_product"] or "your last order")[:22],
"promo_code": f"BACK{c['id']}"[:12]}} for c in chunk],
"description": f"Win-back {today.isoformat()}"})
r.raise_for_status()
with open("winback_mailed.csv", "a", newline="") as f:
csv.writer(f).writerows([c["id"], c["last_order"]] for c in chunk)
print(r.json()["id"], r.json()["count"], r.json()["price"])
print(len(held), "held out this run; compare how many of them order again")mlr_test_ key first: the batches are checked, priced and proofed, and nothing prints or charges.Win-back campaign questions from API senders
When should a win-back card go out?
When a customer passes the point where they'd normally have come back: 60 days without an order for most stores and restaurants, four months without a booking for a groomer, 30 days after a gym membership ends. Use your own customers' usual gap if you know it.
Should a win-back campaign include an offer?
Most win-back cards on this site carry one: a code that expires, or an offer on the next visit. Make the code the customer's own so you can count who used it.
Why mail instead of another email?
A customer who has gone quiet has often stopped opening your email. A card arrives somewhere they still look.
How many win-back cards should one customer get?
One per lapse. The script records which lapse each card was for, so a customer who comes back and lapses again later can get one again.
What does a win-back campaign cost?
The 6x11 win-back card is $0.99 on pay as you go, printing and postage included, so 1,000 lapsed customers is $990.00.