Edit postcard template
spur_update_postcard_templateEdit one of the user's postcard templates and show the updated preview. For text tweaks pass replacements (exact find → replace on a side); to redesign, pass full front_html/back_html. Spur default and gallery templates can't be edited: copy them first with spur_create_postcard_template base_template_id.
Example: change the headline -> replacements=[{side:"front", find:"Just Sold!", replace:"Just Listed!"}]
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 | No | New template name | |
| 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 replacement back HTML | |
| front_html | No | Full replacement front HTML | |
| description | No | Internal note about the template; never printed | |
| template_id | Yes | Template id (UUID from a Spur list/search tool) | |
| replacements | No | Small edits applied in order instead of resending the full content |