No error message when user subscribes a newsletter with an already registered email

luigi-ib
Tourist
11 0 4

Hi Shopify community,

 

I'm creating a landing page having a form with inputs for first name, last name and email. When a new user fills and submits the form, it should be created a new Shopify customer by using these info.

My Shopify store uses the official Dawn theme, without any vendor customization. I implemented the form by using the theme tag "form" in this way:

{% form 'customer', return_to: '/pages/newsletter-thank-you-page' %}
    <input name="contact[first_name]" value="{{ form.first_name }}">
    <input name="contact[last_name]" value="{{ form.last_name }}">
    <input name="contact[email]" value="{{ form.email }}">
    <button type="submit" class="button" name="commit">Registrati</button>
{% endform %}

When the user submits the form successfully for the first time, a new Shopify customer with above info is created as expected. The problem happens when the user submits the form with an already registred email. In that case, after the submit, he is redirected to the same page and there are no errors in Liquid object "form.errors(but the Liquid object "form.posted_successfully?" is false). I already tried to remove the "return_to" parameter from the tag "form", but the problem remains the same.

 

Do you have any idea of the cause of this problem? And how can I show to the user an error message like "This email address has been already taken"?

Reply 1 (1)