{
  "id": "tmpl_abandoned_cart",
  "name": "Abandoned cart",
  "kind": "postcard",
  "status": "draft: confirm with the print partner before production",
  "units": "inches, measured from the trim's top-left corner",
  "size": {
    "label": "6x9",
    "trim": [
      9,
      6
    ],
    "bleed": 0.125,
    "safe_margin": 0.125,
    "page": [
      9.25,
      6.25
    ],
    "orientation": "landscape",
    "aspect_ratio": 1.5
  },
  "usps": {
    "mails_as": "postcard",
    "first_class": "Card price: no larger than 6 x 9 in and no thicker than 0.016 in (DMM 201.1.2.1).",
    "marketing_mail": "USPS Marketing Mail: letter rate (Marketing Mail has no card rate), 200-piece minimum per mailing."
  },
  "paper": "100 lb silk cover, full color on both sides",
  "files": {
    "front": "https://mailr.dev/templates/tmpl_abandoned_cart/front.html",
    "back": "https://mailr.dev/templates/tmpl_abandoned_cart/back.html",
    "spec": "https://mailr.dev/templates/tmpl_abandoned_cart/template.json"
  },
  "sides": {
    "front": "front",
    "back": "back (address side)"
  },
  "merge_fields": [
    {
      "key": "first_name",
      "tag": "{{first_name}}",
      "type": "string",
      "required": true,
      "max_length": 14,
      "example": "Mia"
    },
    {
      "key": "product_name",
      "tag": "{{product_name}}",
      "type": "string",
      "required": true,
      "max_length": 22,
      "example": "Summit Jacket"
    },
    {
      "key": "cart_url",
      "tag": "{{cart_url}}",
      "type": "string",
      "required": true,
      "max_length": 28,
      "example": "acme.co/c/8f2"
    }
  ],
  "content": {
    "mailr_prints": [
      "The recipient’s name and address from `to`, in our font, inside the address block at the bottom right of the back.",
      "Your return address from `from` (required), at the top of the address block.",
      "Postage and the USPS Intelligent Mail barcode, inside the address block."
    ],
    "you_can_add": [
      "Your logo, colors, fonts and images anywhere outside the address block (PNG or JPG at 300 DPI; fonts as TTF, WOFF, WOFF2 or Google Fonts; all on public https URLs).",
      "Your own business address, phone or website in your own style. On the back keep it outside the address block; on the front keep it above the bottom 2.375 in, or use light text on a dark background.",
      "Personal touches from merge fields: first name, offer codes, product names, links. Any {{tag}} you add is filled from merge.",
      "A QR code at least 1 in wide, inside the safe area and outside the address block."
    ],
    "dont_add": [
      "Stamps, permit imprints, “postage paid” or “nonprofit org.” marks, or anything that looks like them. Mailr prints the right indicia for the mail class.",
      "Barcodes that look like USPS barcodes.",
      "The recipient’s address anywhere else on the card.",
      "Sensitive personal data: account numbers, amounts, health or money details. It mails without an envelope, so anyone handling the card can read it.",
      "Crop marks or printer marks.",
      "Anything inside the address block. A white box is printed over it."
    ]
  },
  "clear_zones": [
    {
      "side": "back",
      "name": "address_postage_barcode",
      "x": 4.85,
      "y": 3.5,
      "w": 4,
      "h": 2.375,
      "rule": "Leave blank (bottom right of the back). Mailr prints the return address, recipient address, postage and Intelligent Mail barcode here."
    }
  ],
  "rules": [
    "Backgrounds run to the page edge, through the 0.125 in bleed.",
    "Text, logos and codes stay inside the safe area, 0.125 in inside the trim.",
    "Back: keep the address block (bottom right of the back) blank. Mailr prints the return address there from `from`, which is required.",
    "Front: no address-like text in the bottom 2.375 in, or sorting machines may read the wrong side.",
    "It mails without an envelope: keep account numbers, amounts, health or money details off the card.",
    "Merge tags are replaced as plain text; keep values under max_length.",
    "Fonts must load from a public URL (Google Fonts works)."
  ],
  "fonts": [
    "Inter"
  ],
  "trigger": {
    "source": "Shopify",
    "event": "checkouts/create",
    "when": "a checkout is still open after 48 hours"
  },
  "api": {
    "method": "POST",
    "url": "https://api.mailr.dev/v1/postcards",
    "body": {
      "size": "6x9",
      "template": "tmpl_abandoned_cart",
      "to": "<address object>",
      "from": "<your return address>",
      "merge": {
        "first_name": "Mia",
        "product_name": "Summit Jacket",
        "cart_url": "acme.co/c/8f2"
      }
    },
    "custom_design": "send front and back as HTML strings (edited copies of these files) instead of template"
  },
  "usps_rules": [
    "https://pe.usps.com/text/dmm300/201.htm (DMM 201: sizes and thickness for letters, cards and flats)",
    "https://pe.usps.com/text/dmm300/202.htm (DMM 202: address placement and barcode placement)"
  ]
}
