Skip to main content

Email consent

Customers can consent to email marketing through the theme using a newsletter sign-up form.


Anchor to Newsletter sign-up formNewsletter sign-up form

You can add a newsletter sign-up form to your theme with the Liquid form tag and accompanying 'customer' parameter. Inside the form, you need to include an input with the following attributes:

AttributeValue
typeemail
namecontact[email]

For example:

{% form 'customer' %}
<div className="email">
<label for="email">Email</label>
<input type="email" name="contact[email]" />
</div>

<div className="submit">
<input type="submit" value="Sign up" />
</div>
{% endform %}

When a customer signs up through this form, a customer will be created with the entered email, and the accepts_marketing attribute of the associated customer object will be set to true.

Tip

For another example of a newsletter sign-up form, you can refer to Dawn's implementation.


Was this page helpful?