How can I add a newsletter sign up to my webpage?

Could someone provide the code to add a newsletter sign up to a page?

Thanks!

Hi,

You should already have a newsletter section.

  1. From your Shopify admin, go to Online Store > Themes.

  2. Find the theme that you want to edit, and then click Customize.

  3. Click Add section.

  4. Click Newsletter, then click Add.

  5. Enter a heading for your newsletter signup. For example, “Subscribe to our newsletter”.

  6. In the subheading field, enter a short description of what your customer will receive by subscribing.

  7. Click Save.

Let me know if you still need help

Here is the simple code with no CSS

{% form 'customer' %}
  
    
    
  

  
    
  

{% endform %}

Hi, the code inserts a newsletter but unfortunately the newsletter isn’t functional. You can enter an email but nothing happens.

@kindredpeople ,

As mentioned on my first comment, your theme should already have a newsletter section. You should be able to copy the code or added the section in your page. Those code I provided you needs to connect to your theme code.

Where can I find the code from my theme’s newsletter?

Because I was able to add a newsletter easily on my home page but not on my other regular pages.

Hard to tell without knowing your theme. Usually they have it in the Section folder or Snippet folder

Hi I have debut theme where can i find the code so that i can copy it to my modal?

{%- assign formId = 'Contact_' | append: section.id -%}
    {% form 'customer', id: formId, novalidate: 'novalidate', class: 'contact-form form-single-field' %}
      {%- if form.posted_successfully? -%}
        

          {{ 'general.newsletter_form.confirmation' | t }}
        

      {%- endif -%}
      
      

        
        
          
        
      

      {%- if form.errors contains 'email' -%}
        
          {{ 'general.accessibility.error' | t }} 
          {% include 'icon-error' %}
          {{ form.errors.translated_fields['email'] | capitalize }} {{ form.errors.messages['email'] }}.
        
      {%- endif -%}
    {% endform %}
    

above is the code for the form from debut theme. I put it in a modal window and it works but

  1. there is no form validation

  2. it reloads the page and the modal is lost after that.

see it in action here:

https://dpf8jhebh6pybaaz-52123107526.shopifypreview.com

I need help customizing this.

thanks

RJ