{%- comment -%}
MIT License · (c) 2026 Lintel · https://lintelagency.com/resources/shopify-sections
{%- endcomment -%}
{%- comment -%}
Newsletter popup: an offer with Shopify's customer form (the email is added as a customer tagged
"newsletter" plus a tag you choose), an optional image and an optional discount code with a copy
button. It never shows on first paint: it opens after a delay, when the pointer leaves the top of
the window (desktop only) and/or after the shopper scrolls part of the page, whichever comes
first. On screens below 750px it is a small card at the bottom of the screen that leaves the page
usable, never a full-screen overlay; on desktop a centered modal dialog or a corner card.
Closes with the close button, Esc or a click outside; a closed offer stays away for the days you
set, a sign-up for good, and it shows at most once per visit. After a sign-up the page reloads
with the success message in the popup. Without JavaScript it does not appear at all.
The discount itself is created in Shopify (Discounts); this section only shows the code.
Depends on: none
{%- endcomment -%}
{%- liquid
assign s = section.settings
assign heading_tag = s.heading_tag | default: 'h2'
assign form_id = 'lib-popup-form-' | append: section.id
assign title_id = 'LibPopupTitle-' | append: section.id
assign input_id = 'LibPopupEmail-' | append: section.id
assign error_id = 'LibPopupError-' | append: section.id
assign consent_id = 'LibPopupConsent-' | append: section.id
assign tags = 'newsletter'
if s.customer_tag != blank
assign tags = tags | append: ',' | append: s.customer_tag
endif
assign offer_key = s.heading | strip_html | append: '|' | append: s.discount_code
assign has_image = false
if s.image != blank
assign has_image = true
endif
-%}
Join the studio letter for new pieces and kiln days. One email a month.
" }, { "type": "image_picker", "id": "image", "label": "Image", "info": "Optional. Desktop modal only; the small cards leave it out." }, { "type": "text", "id": "discount_code", "label": "Discount code", "info": "Optional. Create the discount in Shopify under Discounts; this only shows the code." }, { "type": "text", "id": "code_label", "label": "Code label", "default": "Use code" }, { "type": "text", "id": "copy_label", "label": "Copy button", "default": "Copy" }, { "type": "text", "id": "copied_label", "label": "Copied message", "info": "Read by screen readers after copying.", "default": "Code copied" }, { "type": "header", "content": "Form" }, { "type": "text", "id": "input_label", "label": "Field label", "default": "Email address" }, { "type": "text", "id": "placeholder", "label": "Field placeholder", "default": "you@example.com" }, { "type": "text", "id": "button_label", "label": "Button label", "default": "Subscribe" }, { "type": "text", "id": "customer_tag", "label": "Extra customer tag", "info": "Added next to \"newsletter\", so you can tell popup sign-ups apart.", "default": "popup" }, { "type": "inline_richtext", "id": "consent", "label": "Consent text", "default": "Unsubscribe any time. See our privacy policy." }, { "type": "text", "id": "success_message", "label": "Success message", "default": "Thanks for joining. Check your inbox for the code." }, { "type": "text", "id": "close_label", "label": "Close button label", "default": "Close" }, { "type": "header", "content": "When it opens" }, { "type": "checkbox", "id": "trigger_delay", "label": "After a delay", "default": true }, { "type": "range", "id": "delay_seconds", "label": "Delay", "min": 10, "max": 120, "step": 5, "unit": "s", "default": 20, "visible_if": "{{ section.settings.trigger_delay }}" }, { "type": "checkbox", "id": "trigger_exit", "label": "When the pointer leaves the window", "info": "Desktop only.", "default": true }, { "type": "checkbox", "id": "trigger_scroll", "label": "After scrolling", "default": false }, { "type": "range", "id": "scroll_percent", "label": "Scrolled share of the page", "min": 20, "max": 90, "step": 5, "unit": "%", "default": 50, "visible_if": "{{ section.settings.trigger_scroll }}" }, { "type": "range", "id": "remember_days", "label": "Stay closed for", "info": "After a shopper closes it. A sign-up hides it for a year.", "min": 1, "max": 90, "step": 1, "unit": "d", "default": 14 }, { "type": "header", "content": "Layout" }, { "type": "select", "id": "desktop_style", "label": "On desktop", "options": [ { "value": "modal", "label": "Centered dialog" }, { "value": "corner", "label": "Corner card" } ], "default": "modal" }, { "type": "text_alignment", "id": "text_alignment", "label": "Text alignment on desktop", "default": "left" }, { "type": "select", "id": "text_alignment_mobile", "label": "Text alignment on mobile", "options": [ { "value": "left", "label": "Left" }, { "value": "center", "label": "Center" }, { "value": "right", "label": "Right" } ], "default": "left" }, { "type": "select", "id": "show_on", "label": "Show on", "options": [ { "value": "all", "label": "All devices" }, { "value": "desktop", "label": "Desktop only" }, { "value": "mobile", "label": "Mobile only" } ], "default": "all" }, { "type": "header", "content": "Colors" }, { "type": "color", "id": "color_bg", "label": "Background", "default": "#FFFDF9" }, { "type": "color_background", "id": "color_bg_gradient", "label": "Background gradient", "info": "Optional. Covers the background color." }, { "type": "color", "id": "color_text", "label": "Text", "default": "#2A2420" }, { "type": "color", "id": "color_accent", "label": "Accent (button, focus ring)", "default": "#2A2420" }, { "type": "color", "id": "color_accent_text", "label": "Text on accent", "default": "#FFFDF9" }, { "type": "range", "id": "backdrop_opacity", "label": "Page dimming behind the dialog", "min": 0, "max": 80, "step": 5, "unit": "%", "default": 45 }, { "type": "header", "content": "Motion" }, { "type": "checkbox", "id": "animate", "label": "Fade in", "info": "Never when reduced motion is on.", "default": true } ], "presets": [ { "name": "Lib · Newsletter popup" } ] } {% endschema %}