Redirect shopify newsletter signup form after submit

Hi. After my visitors submit their email in the newsletter signup form (in the footer), it shows them a reCapture verification and then shoots to the top of the page, but if they scroll down again, they’ll see “You have been subscribed to our newsletter.” (in place of the submit button).

What I’d like to do is redirect to a thank you page. Here’s what I was trying in newsletter.liquid, but it doesn’t make a difference.

Any ideas?

{%- form 'customer', id: newsletter_id, class: 'Newsletter Form' -%}
          {%- if form.posted_successfully? -%}
        
        
        
            

{{ 'home_page.newsletter.success' | t }}

          {%- else -%}
            {%- if form.errors -%}
              

{{ form.errors.messages['email'] }}

            {%- endif -%}

            
              
              
              
            

          {%- endif -%}
        {%- endform -%}

Hi @charlesr

Aibek is here from Speedimize.io

Hope everything is fine on your end:


Change to this:

Hope that helps you.

1 Like

Cheers for trying. It didn’t work. I tried with and without a semi-colon at the end of the line.

It now goes to the homepage with url like: https://mydomainname.co.uk/?contact%5Btags%5D=newsletter&form_type=customer and doesn’t mark the newsletter box has having worked any more (so it’s doing something. Just not the right thing.

Weird. That should work I would have thought. Anything weird about this form setup? Or is it the reCapture step getting in the way? I’ll try turning off the latter.


{% schema %}
{
  "name": "Newsletter",
  "settings": [
    {
      "type": "select",
      "id": "section_size",
      "label": "Section size",
      "options": [
        {
          "value": "small",
          "label": "Small"
        },
        {
          "value": "normal",
          "label": "Normal"
        },
        {
          "value": "large",
          "label": "Large"
        }
      ],
      "default": "small"
    },
    {
      "type": "image_picker",
      "id": "image",
      "label": "Image",
      "info": "1500 x 800px jpg recommended"
    },
    {
      "type": "color",
      "id": "text_color",
      "label": "Text",
      "default": "#ffffff"
    },
    {
      "type": "color",
      "id": "button_color",
      "label": "Button text",
      "default": "#000000"
    },
    {
      "type": "text",
      "id": "subheading",
      "label": "Sub-heading",
      "default": "Keep updated"
    },
    {
      "type": "text",
      "id": "title",
      "label": "Heading",
      "default": "Newsletter"
    },
    {
      "type": "richtext",
      "id": "content",
      "label": "Text",
      "default": "

A short sentence describing what someone will receive by subscribing

"
    }
  ],
  "presets": [
    {
      "category": "Promotional",
      "name": "Newsletter",
      "settings": {}
    }
  ]
}
{% endschema %}

Hi @charlesr

Can you please share URL of your shop?

So we can elaborate on our solution for you.

On our side, everything works without any problems. So we’re wondering why this happening?

Hi. It’s https://runcompany.co.uk

Will this work on the Debut theme?

In theory, it should work in any theme because the default signup code is the same for everyone. No idea why it didn’t work on mine.

I still find it pretty sad that the signup UX is still broken; with the challenge footer anchor link issue AND this with the lack of control on a signup redirect. 2021…
I wonder if @Kinjaldavra or @diego_ezfy would know? Trying to redirect a user after they signup in the Debut theme using the footer email form. Any ideas? Thank you!

1 Like

You can write this code inside your form tag .

2 Likes

Thank you, that was a simple solution, and it worked great.

Hi @rashiduln ,

how could I use your code but open the page in another tab?

Try this one:


where does this code go? I am trying to redirect to another page after they sign up for mailing list instead of staying on the same page