Purpose#
The Newsletter component renders a full-width newsletter section with an optional header and either:the platform's own subscription form (email input and button), or
the embedded form of a configured newsletter provider.
It replaces the newsletter block that used to be part of the Footer component, so it can be placed in any section of a page.
settings.id: used for the wrapper id comp-{{ id }}.
settings.cssClass: applied only when non-empty and not (UNDEFINED).
settings.header: optional title shown beside the form.
settings.renderMode: Default or ExternalProvider, as configured by the merchant.
renderMode: the mode actually used. It is Default when the provider is deleted, disabled or unavailable, so the platform form is shown as a fallback.
embedHtml: the provider's form markup, used in ExternalProvider mode.
headScripts, bodyScripts: provider scripts. The component does not output them; LayoutA.liquid does.
translations.*: Newsletter, Email, EmailPlaceholder, Subscribe, SubscribeForm, ErrorEmptyField, EmailError, SubmitSuccess, SubmitError.
Render rules#
Default mode: the section always renders with the platform form.
ExternalProvider mode: the section renders only when embedHtml is not empty. Otherwise nothing is output.
Provider scripts#
HeadScripts and BodyScripts are added by LayoutA.liquid only on pages that contain a Newsletter component, once per distinct script, in <head> and before </body>. A custom layout must do the same.
JavaScript#
Default.js declares the global object:[start_code]
const newsletterdefault = {
initComponent(messages) { ... }
}
[end_code]State: isSending, error ("required" or "invalidEmail"), status.clearStatus(): clears the error and status while the user types.
submit(): validates the email (required, then format), then POSTs it to /api/newsletter/subscriptions.
Results are shown as toasts through Alpine.store("toast").add(message, icon, type), using the translated SubmitSuccess and SubmitError messages.
Dependencies#
Alpine.js and the global toast store
LayoutA.liquid for provider scripts
Modified at 2026-11-17 10:35:31