How to add user as subscriber from contact form?

robo_04051
Shopify Partner
10 0 0

I need to include a checkbox on the standard contact form on a contact page. I understand how to add fields, but I want the checkbox, when checked to automatically add the user to our subscriber list. 


What would the input name be for me to achieve this? Or is there a modification I need to do to the form itself?

 

I have tried adding the below, hidden field, but it doesn't add a subscriber. It doesn't seem to do anything.

 

<input type="hidden" name="customer[accepts_marketing]" id="hiddenMarketingCheck" autocorrect="off" value="true" >

I have also tried changing the form_type to customer. That adds the user to the subscriber list. But it doesn't send the admin the user's message from the contact form. 

 

So basically I need a way to be able to send both customer and contact forms. But with one click. 

 

I am surprised there is no easy way to build a subscriber list through a contact form without using a plugin. So if there is any way please help me. 

 

Cheers

Replies 13 (13)

Lilith
Shopify Staff
603 72 185

Hi, @robo_04051!

 

My name is Lilith, I'm on the Social Care team at Shopify.

 

Looks like you did a pretty good job at starting off the code. I would recommend checking in on this developer tutorial here to get a full code for the opt-in value.

 

If you haven't checked in on the placement or options of form fields for the contact page yet, you can find them in the "Add fields to your contact form" tutorial.

 

As an alternative, I highly recommend hiring one of our partners to help you with this. You can find a suitable Shopify Partner in the Experts Marketplace or request a quote by following this guide here.

 

Let me know how you do with the information above! I'm happy to answer any questions you think of as you work on your business.

Lilith | Social Care @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit the Shopify Help Center or the Shopify Blog

robo_04051
Shopify Partner
10 0 0

Hi Lilith,

 

Thanks for sending those links over. But I have seen those already. as I said in my original post, I already know how to add new fields to a form. 

 

As for your link to adding accepts_marketing on a registration form. That was not what I asked. I want to add accepts to accepts_marketing contact page. page.contact.liquid

 

The link you sent me shows me exactly what I did, as explained in my original post. 

<input type="hidden" name="customer[accepts_marketing]" value="" />

The problem seems to be that this does not work with the contact page form 

<input type="hidden" name="form_type" value="contact">
{% form 'contact', id: formId %}

It seems that adding a user with accepts_marketing only works when the form is a customer form

 

<input type="hidden" name="form_type" value="customer">
{% form 'customer', id: formId %}

But then the problem is that it doesn't work as a contact form and it will not send the admin/staff an email with the message that the user has sent in the contact form. It does add them as a customer with accepts_marketing but no longer works as it was originally intended to. 

 

So my question still remains. How can I add a user to the subscriber list from the Contact Form

Lilith
Shopify Staff
603 72 185

@robo_04051 Thanks for breaking that down, I appreciate it. I'm glad that you've already reviewed those reference points for help. Which theme are you currently using?

Lilith | Social Care @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit the Shopify Help Center or the Shopify Blog

robo_04051
Shopify Partner
10 0 0

There are multiple sites I need to do this on. Some are custom themes that I believe were originally built on an old Timber Framework. But the newer sites are customised from Debut. 

robo_04051
Shopify Partner
10 0 0

@Lilith Did you get my previous reply regarding the themes we are using? 

Lilith
Shopify Staff
603 72 185

Hi, @robo_04051 . I was away for a bit, just read your reply. Thanks for adding the extra information! 

Since the theme is likely not up to date to the newest version of Debut and the code may be very customized, this could be beyond the scope of our support team. I won't be able to know exactly how to work around the existing customizations.

However, I know that you can definitely rely on some amazing talent in the Experts Marketplace to help dive in and do some code work for you. They'll give you the results you're looking for if you've not been able to find a viable solution on the Shopify Community forums.

Lilith | Social Care @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit the Shopify Help Center or the Shopify Blog

robo_04051
Shopify Partner
10 0 0

@Lilith, In that case, can you please give me a solution for an up to date Debut theme. 

robo_04051
Shopify Partner
10 0 0

@Lilith Can you please provide me with a solution for a Debut theme? 

Lilith
Shopify Staff
603 72 185

@robo_04051 we'd need to send this to the development team to take a look at to see if this is something they can resolve and cover for you under your 60 minutes of free design time. However, your Debut theme must be free of customizations. If you'd like me to send that to them let me know here and we can begin the process of seeing if this can be done for you.

As mentioned I do recommend requesting a quote from a Shopify Partner (Expert's Marketplace) if you're needing something done right away or if your customization isn't covered under our design policy.

Lilith | Social Care @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit the Shopify Help Center or the Shopify Blog

robo_04051
Shopify Partner
10 0 0

Hi @Lilith 

Something like this should be standard. Its just a simple adding to subscriber list and I beleive should be standard for any contact form. If a shopify partner or expert can do it, then sure it should be documented in your API and developer docs. So yes, please do pass this on to your development team. I am happy to create a fresh new debut theme test site for this to be done. then we can custimise it for all our other sites from there. https://testingforms0405.myshopify.com/

Lilith
Shopify Staff
603 72 185

I completely understand. I'll send this to the development team as a suggestion for their free themes to include in future updates.

I can't guarantee that if the theme development team is able to do this, that it'll work on a different or more customized version of themes. However, we can give it a go. I've sent over an email to authenticate you and continue the conversation there.

Make sure that the account we're reviewing for customization has the Basic plan or higher to ensure you have that complimentary design time in the account and we can get started on connecting you to the theme devs for review. Don't forget you can download a new copy of the theme to any existing account that already has it as well.

Lilith | Social Care @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit the Shopify Help Center or the Shopify Blog

LIxiao
Shopify Partner
5 0 0

Hello, can you tell me how to increase it?

Jahid-KlinKode
Excursionist
145 1 4

Hey @robo_04051, learn how to add a personal touch to your Shopify contact form with custom fields like text, dropdowns, radio buttons, and checkboxes. Watch the tutorial here: