Direct mail for growth teams, with an API underneath. Read the docs →

Direct mail for gyms and studios, triggered by member events

Direct mail for gyms reaches the members email doesn't: the intro-offer buyer who never booked a second class, the member who canceled last month, the regular about to hit a hundred check-ins. Mailr sends each card from a Mindbody, PushPress or Stripe event, and prints the challenge posters and class-schedule flyers for the front desk.

Who builds this

The developer at a multi-location studio brand subscribed to Mindbody's Webhooks API. The gym-marketing agency running HighLevel funnels for dozens of independent gyms and CrossFit boxes. The fitness SaaS that bills memberships through Stripe and wants a mailed piece in its automations. They keep each member's address from the client events, record contract and check-in events, and let a nightly job decide who gets mail and when.

What to mail, and when

When this happensMail thisPrice
Mindbody client.created for a new member (the payload includes addressLine1, city, state, postalCode)A welcome letter from the owner with the first-week class plan. (8.5x11 letter, Welcome letter)$0.95
An intro-offer buyer with one classRosterBooking.created in 10 days and no clientContract.createdA small card: their second class is on the house this week. (4x6 postcard)$0.85
Mindbody clientContract.cancelled, 30 days on, with no new contract sinceA win-back card that names their favorite class. (6x11 postcard, Win-back)$0.99
Stripe invoice.payment_failed on the final retry, for studios billing dues through StripeA discreet paper reminder to update the card on file. (8.5x11 letter, Failed payment)$0.95
PushPress New Check-In that is the member's 100thA milestone card signed by the coaches. (6x9 postcard)$0.89

What gyms and fitness print

Printed and picked up free in Phoenix or shipped UPS Ground, ordered with POST /v1/prints.

PieceUsed forPrice
24x36 posterSix-week challenge and New Year posters for the lobby and front window, from one.$19.20
18x24 posterClass-schedule and coach-lineup posters by the check-in desk.$9.60
8.5x11 flyerGrand-opening, bring-a-friend and class-schedule flyers, from 100.$0.53, from 100
4x9 rack cardFront-desk cards with membership options and the intro offer.$0.26, from 100

Systems to connect

  • Mindbody. Webhooks API subscriptions: client.created and client.updated (addressLine1, addressLine2, city, state, postalCode), clientContract.created and clientContract.cancelled, clientMembershipAssignment.created, classRosterBooking.created. Each request carries X-Mindbody-Signature, an HMAC-SHA256 of the body keyed with the subscription's messageSignatureKey.
  • PushPress. Zapier triggers New Subscription, Canceled Subscription and New Check-In; send them to your endpoint, or build the flow from the Zapier and n8n recipe.
  • Stripe. customer.subscription.deleted for cancellations and invoice.payment_failed for failed dues when memberships bill through Stripe; the Customer's address fills the to object.
  • HighLevel. A ContactTagUpdate webhook when a lead is tagged toured, no-show or trial ended; contacts carry address1, city, state and postalCode.

Welcome new Mindbody members, win back cancellations, print challenge posters

// app/api/mindbody/route.js: subscribed to client.created, client.updated and clientContract.cancelled.
import crypto from "node:crypto";

export async function POST(req) {
  const raw = await req.text();
  const expected = "sha256=" + crypto.createHmac("sha256", process.env.MINDBODY_SIGNATURE_KEY).update(raw, "utf8").digest("base64");
  const got = req.headers.get("x-mindbody-signature") ?? "";
  if (expected.length !== got.length || !crypto.timingSafeEqual(Buffer.from(expected), Buffer.from(got))) {
    return new Response("Bad signature", { status: 401 });
  }
  const { eventId, eventData: d } = JSON.parse(raw);

  if (eventId === "client.created" || eventId === "client.updated") {
    await saveMember(d.siteId, d.clientId, d); // keep the address: contract events only carry ids
  }
  if (eventId === "clientContract.cancelled") {
    await markCanceled(d.siteId, d.clientId, d.clientContractId); // the nightly job mails 30 days later
  }

  if (eventId === "client.created" && d.addressLine1 && d.postalCode) {
    const res = await fetch("https://api.mailr.dev/v1/flats", {
      method: "POST",
      headers: {
        Authorization: `Bearer ${process.env.MAILR_API_KEY}`,
        "Content-Type": "application/json",
        "Idempotency-Key": `mb-welcome-${d.siteId}-${d.clientId}`,
      },
      body: JSON.stringify({
        size: "8.5x11",
        template: "tmpl_welcome",
        to: {
          name: `${d.firstName} ${d.lastName}`,
          line1: d.addressLine1,
          ...(d.addressLine2 ? { line2: d.addressLine2 } : {}),
          city: d.city,
          state: d.state,
          zip: d.postalCode,
        },
        // Reads: "A short note from Sam about getting your first week set up."
        merge: { first_name: d.firstName.slice(0, 14), founder_name: "Sam", company: "your first week" },
        description: `Mindbody welcome, site ${d.siteId} client ${d.clientId}`,
      }),
    });
    const flat = await res.json();
    if (!res.ok) throw new Error(flat.error.message);
  }
  return Response.json({ ok: true });
}

What it costs

New Year rejoin offer to former members: 1,200 6x11 postcards at $0.99 each is $1,188.00 on pay as you go, or $852.00 on the Agency plan, printing and postage included. Members who canceled in the last 12 months, mailed the last week of December as two batches (1,000 and 200). Test pieces are free. All prices.

Questions

Does Mindbody's cancellation webhook include the member's address?

No. clientContract.cancelled carries siteId, clientId, clientUniqueId and clientContractId. The address arrives on client.created and client.updated (addressLine1, city, state, postalCode), so store it from those events and join on clientId.

How do I mail 30 days after a cancellation?

Record the cancellation from the webhook and run a nightly job that mails members canceled 30 days ago who haven't bought a new contract. Mailr prints and mails when you call it; the timing lives in your job.

Is the failed-payment flat safe to mail without an envelope?

tmpl_payment_failed was written for open mail: it names the plan and the update URL, never an amount or card details. It takes first_name, plan (12 characters at most) and update_url (28 characters at most). Keep custom designs just as discreet.

What does a New Year mailing to former members cost?

1,200 6x11 postcards is $1,188 pay as you go, $1,020 on Studio or $852 on Agency, printing and postage included. POST /v1/batches takes up to 1,000 recipients, so send it as two batches.

GYMS AND FITNESS

Build mail for gyms and fitness today

Get a free test key, send a test postcard or print order, and watch it move through every status.

  • Postcards, flats and folded mailers
  • A proof before anything prints
  • Free test mode: nothing prints, nothing charges
  • A status for every piece

Download the template kit?

mailr-kit.zip · about 310 KB · 65 text files

Only HTML, JSON and Markdown files. No programs, scripts or macros, nothing that installs or runs.