/newsletter/subscribe
{% form 'newsletter_subscribe' %}
Subscribes the email to the store newsletter. Double opt-in applies when the store requires confirmation, and the confirmation link lands on /newsletter/confirm: the platform Email subscription page (not a theme template), where the subscriber confirms with a button, since opening the link changes nothing. An already-active subscription returns success unchanged; a pending request receives a fresh confirmation. The honeypot suppresses simple bots. With phone and accepts_text_marketing true it also records SMS and WhatsApp marketing consent for that number; a form may sign up only a phone.
Form fields
-
emailOptional Subscriber email. Required unless the form signs up a phone for texts (phone with accepts_text_marketing true).
-
phoneOptional Phone to sign up for marketing texts: international format starting with +, or a national number read in phone_country. Read only when accepts_text_marketing is true and customer_settings.collect_text_marketing_consent is true.
-
phone_countryOptional ISO 3166-1 alpha-2 country of a national phone number. Defaults to customer_settings.default_phone_country.
-
accepts_text_marketingOptional true gives SMS and WhatsApp marketing consent for phone (source website), with the wording in customer_settings.text_marketing_consent_label kept as evidence. Show that wording next to an unticked box.
-
websiteOptional Honeypot — must stay empty; bots that fill it are dropped.
-
_formatOptional Set to json when submitting with fetch; omit for the normal browser redirect.
Validation
Valid non-empty email; CSRF and honeypot enforced. An active subscription returns success unchanged. A pending double-opt-in subscription receives a new confirmation token and email. Hosted submissions are recorded with source=website.
Limits
Subscribing an address that is already subscribed changes nothing. Under heavy traffic the store may ask the browser to complete a short challenge first.
Response
{
success:true,
response,
requires_confirmation
}