All things Shopify and commerce
Hello,
I have some problems with my newsletter. When I enter an email adress and then press the button, a new browser pops with an error.
Could you please advise on this issue?
Thank you
Hello @Sovel ,
Could you please share your website url here?
Hi@Sovel. Your newsletter signup code is not correct.
Your form action is empty.
Is it possible to share the code of files like newsletter.liquid or email-signup.liquid?
@Sovel. Your form action should be like this.
Hello,
Here is the code for home-lewsletter.liquid.
@Sovel. I think there are some errors in your code.
But if it is working in your side, then leave it at it is.
Just replace
<form action="{{ section.settings.mailing_list_form_action }}" method="post" name="mc-embedded-subscribe-form" target="_blank" class="input-group">
with this line
{% form 'customer' %}
There are many issues. Like:
1. Missing translations
2. input field don't have the necessary name field.
You can view the below code and update your code accordingly.
{% form 'customer', class: 'newsletter-form' %}
<input type="hidden" name="contact[tags]" value="newsletter">
<div class="newsletter-form__field-wrapper">
<div class="field">
<input
id="NewsletterForm--{{ section.id }}"
type="email"
name="contact[email]"
class="field__input"
value="{{ form.email }}"
aria-required="true"
autocorrect="off"
autocapitalize="off"
autocomplete="email"
{% if form.errors %}
autofocus
aria-invalid="true"
aria-describedby="Newsletter-error--{{ section.id }}"
{% elsif form.posted_successfully? %}
aria-describedby="Newsletter-success--{{ section.id }}"
{% endif %}
placeholder="{{ 'newsletter.label' | t }}"
required
>
<label class="field__label" for="NewsletterForm--{{ section.id }}">
{{ 'newsletter.label' | t }}
</label>
<button
type="submit"
class="newsletter-form__button field__button"
name="commit"
id="Subscribe"
aria-label="{{ 'newsletter.button_label' | t }}"
>
{% render 'icon-arrow' %}
</button>
</div>
{%- if form.errors -%}
<small class="newsletter-form__message form__message" id="Newsletter-error--{{ section.id }}">
{%- render 'icon-error' -%}
{{- form.errors.translated_fields.email | capitalize }}
{{ form.errors.messages.email -}}
</small>
{%- endif -%}
</div>
{%- if form.posted_successfully? -%}
<h3
class="newsletter-form__message newsletter-form__message--success form__message"
id="Newsletter-success--{{ section.id }}"
tabindex="-1"
autofocus
>
{% render 'icon-success' -%}
{{- 'newsletter.success' | t }}
</h3>
{%- endif -%}
{% endform %}
without the customer form and necessary name attributes of input fields, newsletter will not work
Let us know if you've any queries.
I dont get it. Its giving me errors over errors. Am i supposed to replace the whole line of form with the line you provided?
Yes you can try. If it stilling giving the error, share the code again pleas.
Hello,
Sorry for the late response. Its giving this error if I try to replace the code with the line your provided.
Also, there is another newsletter liquid called: newsletter-form.liquid. I attached the code for this code, maybe this is what causes the problem.
{% comment %}
MailChimp is the go-to newsletter service for Shopify.
Use the link below to find your MailChimp "form action"
and insert it in your site settings.
MailChimp newsletter integration and requirement:
- http://docs.shopify.com/support/configuration/store-customization/where-do-i-get-my-mailchimp-form-a...
{% endcomment %}
<form action="{{ settings.mailing_list_form_action }}" method="post" name="mc-embedded-subscribe-form" class="input-group {% if settings.display_ajax_mailchimp %} clv-ajax-from {% endif %}">
<div class="input-group newsletter_form_content">
<input type="email" value="" placeholder="{{ 'footer.footer_newsletter_content' | t }}" name="EMAIL" class="input-group-field" aria-label="Email Address">
<div class="message-newsneter"></div>
<span class="input-group-btn">
<input type="submit" class="btn harman_btn4" value="{{ 'footer.footer_newsletter_go' | t }}" name="subscribe">
</span>
</div>
</form>
In Canada, payment processors, like those that provide payment processing services t...
By Jacqui Mar 14, 2025Unlock the potential of marketing on your business growth with Shopify Academy's late...
By Shopify Mar 12, 2025Learn how to increase conversion rates in every stage of the customer journey by enroll...
By Shopify Mar 5, 2025