{% if section.settings.enable_newsletter %}
<div class="promo-pop__form">
{% form 'customer' %}
{{ form.errors | default_errors }}
{% if form.posted_successfully? %}
{% comment %}Set delay to 0 so form message is visible instanlty{% endcomment %}
{%- assign popup_delay = 0 -%}
<div class="promo-pop__form-message">
<h4 class="promo-pop__form-message__text">{{ 'general.newsletter_form.confirmation' | t }}</h4>
</div>
{% else %}
<div class="promo-pop__fieldset">
<input type="hidden" name="contact[tags]" value="newsletter">
<input type="email"
name="contact[email]"
id="Email"
class="promo-pop__fieldset-item promo-pop__input"
value="{% if customer %}{{ customer.email }}{% endif %}"
placeholder="{{ 'general.newsletter_form.newsletter_email' | t }}"
autocorrect="off"
autocapitalize="off">
<button type="submit" class="c-btn c-btn--primary c-btn--arrow promo-pop__fieldset-item promo-pop__btn" name="commit" id="Subscribe">{{ 'general.newsletter_form.submit' | t }}</button>
</div>
{% endif %}
{% endform %}
</div>
{% endif %}
<div class="promo-pop__form">
{% form 'customer' %}
{{ form.errors | default_errors }}
{% if form.posted_successfully? %}
{% comment %}Set delay to 0 so form message is visible instanlty{% endcomment %}
{%- assign popup_delay = 0 -%}
<div class="promo-pop__form-message">
<h4 class="promo-pop__form-message__text">{{ 'general.newsletter_form.confirmation' | t }}</h4>
</div>
{% else %}
<div class="promo-pop__fieldset">
<input type="hidden" name="contact[tags]" value="newsletter">
<input type="email"
name="contact[email]"
id="Email"
class="promo-pop__fieldset-item promo-pop__input"
value="{% if customer %}{{ customer.email }}{% endif %}"
placeholder="{{ 'general.newsletter_form.newsletter_email' | t }}"
autocorrect="off"
autocapitalize="off">
<button type="submit" class="c-btn c-btn--primary c-btn--arrow promo-pop__fieldset-item promo-pop__btn" name="commit" id="Subscribe">{{ 'general.newsletter_form.submit' | t }}</button>
</div>
{% endif %}
{% endform %}
</div>
{% endif %}
No comments:
Post a Comment