How to add user as subscriber from contact form?

Highlighted
Tourist
8 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

0 Likes
Highlighted
Shopify Staff
Shopify Staff
324 38 72

Hi, @threelyonsSE!

 

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

0 Likes
Highlighted
Tourist
8 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

0 Likes
Highlighted
Shopify Staff
Shopify Staff
324 38 72

@threelyonsSE 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

0 Likes
Highlighted
Tourist
8 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. 

0 Likes
Highlighted
Tourist
8 0 0

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

0 Likes
Highlighted
Shopify Staff
Shopify Staff
324 38 72

Hi, @threelyonsSE . 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

0 Likes
Highlighted
Tourist
8 0 0

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

0 Likes
Highlighted
Tourist
8 0 0

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

0 Likes
Highlighted
Shopify Staff
Shopify Staff
324 38 72

@threelyonsSE 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

0 Likes