Create postcard template
spur_create_postcard_templateCreate a postcard template and show a preview. Three ways to start:
From blank: start_from_blank=true gives an empty, correctly sized canvas for the size (any side you pass HTML for replaces the blank side).
Redesign an existing template: base_template_id (yours, a Spur default or a gallery id) copies its HTML; override front_html/back_html/size as needed.
From scratch: pass both front_html and back_html.
HTML guidance (see spur://postcard-design-guide): full HTML documents, inline , no scripts. Fixed pixel sizing on html, body and a root .postcard at 300 px/in including 0.125" bleed: 6x4 → 1875×1275, 6x9 → 2775×1875, 6x11 → 3375×1875. Keep text 0.25" inside the edge. USPS clear zone on the back, measured from the bleed edges (Spur prints over it and covers anything there): postage 1.25"×1.25" in the top-right corner; address block 3.5"×2", 0.5" from the right edge and 1.35" from the top; USPS barcode strip 4.75"×0.625" along the bottom-right edge. Keep all text, logos, photos and QR codes out of it; a background color or texture under it is fine. The safe message area is left of the address block and above the barcode strip. Images as absolute https URLs. The user's own images (logo, headshot, property photos): spur_list_images gives their URLs; if they want to use an image they have, call spur_upload_image (or spur_save_image for a link) and use the saved URL. Use merge fields such as {{owner_first_name}}, {{property_address}}, {{your_name}}, {{your_phone}}, {{company_name}} (see spur://merge-variables). QR code box by default: unless the user says they don't want a QR code, every back you design includes an empty square in the message area (≥ 0.75in, e.g. 225×225 px at 300 px/in) with a short call to action beside it ("Scan to see your home's value"). Never write QR markup or {{qrUrl}} yourself: after saving, call spur_add_postcard_qr_code and the tracked QR fills the box (pick the code with spur_list_qr_codes, or ask the user where scans should go and spur_create_qr_code). When resending full back_html, keep the qr-box and any <img data-spur-qr-merge…> inside it, or the QR is dropped.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Template name shown in Spur | |
| size | No | Postcard size: "6x4" (standard 4×6), "6x9" or "6x11" | |
| category | No | Category label, e.g. "Just Sold" or "Market Update" | |
| back_html | No | Full back-side HTML; keep the address block area clear | |
| front_html | No | Full front-side HTML | |
| description | No | Internal note about the template; never printed | |
| base_template_id | No | Copy this template's HTML and size as the starting point | |
| start_from_blank | No | Start from an empty canvas sized for `size` |