Hello, Community
Using the accepts_marketing checkbox, I’m attempting to enable customers to opt-in for email marketing when they register on a custom customer registration form that I’m integrating into my Shopify theme.
This is the code that I’m using right now:
<div class="form-field accepts-marketing"> <input type="hidden" name="customer[accepts_marketing]" value="false" /> <input type="checkbox" name="customer[accepts_marketing]"
Value="true" id="RegisterForm-AcceptsMarketing"
class="form-checkbox" > label for="RegisterForm-AcceptsMarketing" class="form-label">
Sign up for email marketing
</label> </div>
Although the checkbox functions properly and submits without any issues, the newly registered customers are not marked as marketing subscribers in the admin’s Customers section even when it is checked.
I have confirmed that:
The input name is customer[accepts_marketing]
The value is appropriately set to “true.”
The input is inside the {% form ‘create_customer’ %} block
Still, the customers are being created with accepts_marketing = false.
Has anyone faced this issue before? Is there something I’m missing or an update to how Shopify handles this field?
Thanks in advance!