How does adding a custom newsletter signup form affect customer visibility?

Solved

How does adding a custom newsletter signup form affect customer visibility?

ib3
Visitor
3 1 2

Hi there

 

Does adding:

 

<input type="hidden" name="customer[tags]" value="newsletter">

to the "customer" form, magically make those customers appear in the "Accepts Marketing" section of the admin, or do I need to add accepts_marketing as a hidden field with value true?

 

In the examples of newsletter forms I've seen, including the official starter theme, there is just a tag of newsletter. The theme I'm working on doesn't use sections, if that makes any difference.

 

TIA

Jamie

Accepted Solution (1)
ib3
Visitor
3 1 2

This is an accepted solution.

For anyone else stumbling on this post, it seems that "Accepts marketing" is set by default just by using this form type:

 

{% form 'customer' %}

It would be useful if this was documented along with the fact that you need to use "contact[]" and not "customer[]" field names with this form. The documentation could be improved further by explaining what happens when the customer is already added. For that it seems, the behaviour is to just reload the page with the parameters in the URL and supply no form errors.

View solution in original post

Replies 8 (8)

James-G
Excursionist
25 2 9

I think this is the info you're looking for:
https://help.shopify.com/en/themes/customization/forms/get-consent-for-promotional-emails

See step #5 specifically.

 

Hope that helps

ib3
Visitor
3 1 2

This is an accepted solution.

For anyone else stumbling on this post, it seems that "Accepts marketing" is set by default just by using this form type:

 

{% form 'customer' %}

It would be useful if this was documented along with the fact that you need to use "contact[]" and not "customer[]" field names with this form. The documentation could be improved further by explaining what happens when the customer is already added. For that it seems, the behaviour is to just reload the page with the parameters in the URL and supply no form errors.

Eric_Seastrand
Shopify Partner
53 3 48

To expand on ib3's comments: it seems you can add any arbitrary customer field to the form and it gets saved in the customer record. For example, if you wanted to add inputs for first and last name to the newsletter form, you could do that with HTML like this:

 

<input type="text" name="contact[first_name]" placeholder="Enter your first name">
<input type="text" name="contact[last_name]"  placeholder="Enter your last name" >

 

 

Here's the customer account it created
Eric_Seastrand_0-1594247840123.png

amirpj
Excursionist
22 0 7

I not finding any solution to add a phone number to the customer overview section. Anybody has solved this issue

Eric_Seastrand
Shopify Partner
53 3 48

That should be possible yes.

Admittedly, I'm not quite sure what you mean by the "customer overview" section. Is this when creating the account? In a newsletter form? Customer edit page?
It's best if you can upload a screenshot of where you want this to show up, and include the URL bar in the screenshot. A link to your actual store would be even better.

In any case, I'd bet that the solution described in my forum post above will work. Have you tried that already? If so, screenshot your Liquid so we can see what didn't work and advise accordingly. We're all learning this stuff together 🙂

Chris_Sydney
Shopify Partner
110 4 23

Hey Eric, 

Sorry to jump in on this, but have you got this working with Dawn theme?

Eric_Seastrand
Shopify Partner
53 3 48

I haven't tried yet with the Dawn theme, but it should work exactly the same way. Just add an input with a name like: 

name="contact[first_name]"

I say should because the handling of those form inputs is all handled server-side, independently of what theme you're using. I guess it's possible the handling is different for Dawn vs Debut, but that seems highly unlikely.

In any case, let us know if you end up trying it / whether it worked or not.

Kate_Rachel_Loz
Tourist
6 0 0

Hi, I tired to put this html into an existing page and it would not take....just stayed as html code.   what am I doing wrong?  I have the checkbox on the cart but I wanted to put the sign up to newsletter in my blog and on a couple of other pages.  I use the Supply theme.  Thanks for any help that you can offer!