---
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
api_name: liquid
---

# Email consent

Customers can consent to email marketing through the theme using a [newsletter sign-up form](#newsletter-sign-up-form).

***

## 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' %}
<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](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).

***
