--- title: Email consent description: Learn how to let customers give merchants consent for email marketing. source_url: html: https://shopify.dev/docs/storefronts/themes/customer-engagement/email-consent md: https://shopify.dev/docs/storefronts/themes/customer-engagement/email-consent.md --- ExpandOn this page * [Newsletter sign-up form](https://shopify.dev/docs/storefronts/themes/customer-engagement/email-consent#newsletter-sign-up-form) * [Customer registration form checkbox](https://shopify.dev/docs/storefronts/themes/customer-engagement/email-consent#customer-registration-form-checkbox) # Email consent There are two ways that a customer can consent to email marketing through the theme: * [A newsletter sign-up form](#newsletter-sign-up-form) * [A checkbox input in the customer register form](#customer-registration-form-checkbox) *** ## Newsletter sign-up form You can add a newsletter sign-up form to your theme with the Liquid [form tag](https://shopify.dev/docs/api/liquid/tags/form#form-customer) and accompanying `'customer'` parameter. Inside the form, you need to include an input with the following attributes: | Attribute | Value | | - | - | | `type` | `email` | | `name` | `contact[email]` | For example: ```liquid {% form 'customer' %}
{% 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](https://shopify.dev/docs/api/liquid/objects/customer) will be set to `true`. Tip For another example of a newsletter sign-up form, you can refer to [Dawn's implementation](https://github.com/Shopify/dawn/blob/main/sections/footer.liquid). *** ## Customer registration form checkbox Inside the [customer register form](https://shopify.dev/docs/storefronts/themes/architecture/templates/customers-register#the-customer-register-form), you can include a checkbox to allow customers to consent email marketing. This requires the following inputs to be placed inside the form: | Input | type | name | | - | - | - | | Accepts marketing | `hidden` | `customer[accepts_marketing]` | | Accepts marketing | `checkbox` | `customer[accepts_marketing]` | For example: ```liquid {% form 'create_customer' %} {{ form.errors | default_errors }}
{% endform %} ``` Tip This solution requires a hidden input, as well as the checkbox input, as an unchecked box won't record a value when the form is submitted. *** * [Newsletter sign-up form](https://shopify.dev/docs/storefronts/themes/customer-engagement/email-consent#newsletter-sign-up-form) * [Customer registration form checkbox](https://shopify.dev/docs/storefronts/themes/customer-engagement/email-consent#customer-registration-form-checkbox)