Adding code to customer account sign up page to connect to mailing list?

Highlighted
New Member
1 0 0

Is there code I can add to my theme to allow customers to sign up to my mailing list when making a customer account profile?

0 Likes
Highlighted
Shopify Expert
55 10 21

Hey @riemac!

If you're comfortable adding code to your theme using the code editor in Shopify, then you can add an input field to your store's registration form which would enable the 'Accepts Marketing' setting in Shopify for customers who register for an account. This is done by using the following name attribute for a HTML input element:

customer[accepts_marketing]

For example, you could add something like the code below to show a newsletter signup checkbox that is checked by default. I'd suggest adding this after the email input field, before the {% endform %} tag on your theme's registration template (normally templates/customers/register.liquid)

 

<input type="checkbox" name="customer[accepts_marketing]" checked="checked" value="true" id="marketing" />
<label for="marketing" style="font-weight:normal">I want to signup for the newsletter</label>

 

If you are not comfortable editing code, then I would suggest looking at the Customer Fields app. The app's form builder has a built-in field for Accepts Marketing, and you can easily create & install a customized registration form that matches your store's theme styles -- all without having to edit any of your theme's form code.

 

Hopefully this helps!

Kyle W | Helium Dev, LLC
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Click Accept as Solution
Helium builds user friendly apps with top-rated US-based support
Our apps: Customer Fields & Meteor Mega Menus
0 Likes