Skip to content
This repository has been archived by the owner on Aug 30, 2018. It is now read-only.

Commit

Permalink
Merge pull request #497 from Shopify/add-newsletter-fallback
Browse files Browse the repository at this point in the history
Add Shopify newsletter fallback
  • Loading branch information
cshold committed Jan 15, 2016
2 parents 0062e41 + a671733 commit 2a01e34
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 14 deletions.
32 changes: 24 additions & 8 deletions layout/theme.liquid
Expand Up @@ -331,21 +331,37 @@
Use the link below to find your MailChimp form action
and insert it in your site settings.
If the form action URL is not set in the theme settings,
it will fallback to a customer form so you can still capture the email.
MailChimp newsletter integration and requirement:
- http://docs.shopify.com/support/configuration/store-customization/where-do-i-get-my-mailchimp-form-action
{% endcomment %}
<h3>{{ 'layout.footer.newsletter_title' | t }}</h3>
{% if settings.newsletter_form_action != blank %}
{% assign form_action = settings.newsletter_form_action %}
<form action="{{ settings.newsletter_form_action }}" method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" target="_blank" class="input-group">
<input type="email" value="{% if customer %}{{ customer.email }}{% endif %}" placeholder="{{ 'general.newsletter_form.newsletter_email' | t }}" name="EMAIL" id="mail" class="input-group-field" aria-label="{{ 'general.newsletter_form.newsletter_email' | t }}" autocorrect="off" autocapitalize="off">
<span class="input-group-btn">
<input type="submit" class="btn" name="subscribe" id="subscribe" value="{{ 'general.newsletter_form.submit' | t }}">
</span>
</form>
{% else %}
{% assign form_action = '#' %}
{% form 'customer' %}
{{ form.errors | default_errors }}
{% if form.posted_successfully? %}
<p class="note form-success">{{ 'general.newsletter_form.confirmation' | t }}</p>
{% else %}
<div class="input-group">
<input type="email" value="{% if customer %}{{ customer.email }}{% endif %}" placeholder="{{ 'general.newsletter_form.newsletter_email' | t }}" name="contact[email]" id="Email" class="input-group-field" aria-label="{{ 'general.newsletter_form.newsletter_email' | t }}" autocorrect="off" autocapitalize="off">
<input type="hidden" name="contact[tags]" value="newsletter">
<span class="input-group-btn">
<input type="submit" class="btn" name="subscribe" id="subscribe" value="{{ 'general.newsletter_form.submit' | t }}">
</span>
</div>
{% endif %}
{% endform %}
{% endif %}
<form action="{{ form_action }}" method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" target="_blank" class="input-group">
<input type="email" value="{% if customer %}{{ customer.email }}{% endif %}" placeholder="{{ 'general.newsletter_form.newsletter_email' | t }}" name="EMAIL" id="mail" class="input-group-field" aria-label="{{ 'general.newsletter_form.newsletter_email' | t }}" autocorrect="off" autocapitalize="off">
<span class="input-group-btn">
<input type="submit" class="btn" name="subscribe" id="subscribe" value="{{ 'general.newsletter_form.submit' | t }}">
</span>
</form>

</div>
{% endif %}
<div class="grid__item text-center">
Expand Down
3 changes: 2 additions & 1 deletion locales/de.json
Expand Up @@ -14,7 +14,8 @@
},
"newsletter_form": {
"newsletter_email": "email@beispiel.com",
"submit": "Abonnieren"
"submit": "Abonnieren",
"confirmation": "Danke fürs Anmelden"
},
"search": {
"no_results_html": "Ihre Suche nach \"{{ terms }}\" hat keine Ergebnisse hervorgebracht.",
Expand Down
3 changes: 2 additions & 1 deletion locales/en.default.json
Expand Up @@ -14,7 +14,8 @@
},
"newsletter_form": {
"newsletter_email": "email@example.com",
"submit": "Subscribe"
"submit": "Subscribe",
"confirmation": "Thanks for subscribing"
},
"search": {
"no_results_html": "Your search for \"{{ terms }}\" did not yield any results.",
Expand Down
3 changes: 2 additions & 1 deletion locales/es.json
Expand Up @@ -14,7 +14,8 @@
},
"newsletter_form": {
"newsletter_email": "email@ejemplo.com",
"submit": "Suscribir"
"submit": "Suscribir",
"confirmation": "Gracias por suscribirse"
},
"search": {
"no_results_html": "Su búsqueda de \"{{ terms }}\" no tuvo resultados.",
Expand Down
3 changes: 2 additions & 1 deletion locales/fr.json
Expand Up @@ -14,7 +14,8 @@
},
"newsletter_form": {
"newsletter_email": "courriel@exemple.com",
"submit": "S'inscrire"
"submit": "S'inscrire",
"confirmation": "Merci de vous être inscrit"
},
"search": {
"no_results_html": "Votre recherche pour \"{{ terms }}\" n'a pas généré de résultats.",
Expand Down
3 changes: 2 additions & 1 deletion locales/pt-BR.json
Expand Up @@ -14,7 +14,8 @@
},
"newsletter_form": {
"newsletter_email": "e-mail@exemplo.com",
"submit": "Inscrever"
"submit": "Inscrever",
"confirmation": "Obrigado por assinar"
},
"search": {
"no_results_html": "Sua busca por \"{{ terms }}\" não gerou resultados.",
Expand Down
3 changes: 2 additions & 1 deletion locales/pt-PT.json
Expand Up @@ -14,7 +14,8 @@
},
"newsletter_form": {
"newsletter_email": "email@exemplo.com",
"submit": "Subscrever"
"submit": "Subscrever",
"confirmation": "Obrigado pela sua subscrição"
},
"search": {
"no_results_html": "A sua pesquisa por \"{{ terms }}\" não produziu resultados.",
Expand Down

0 comments on commit 2a01e34

Please sign in to comment.