Ad

Add Another Email List For Shopify

- 1 answer

Currently working in shopify to add another email list.

The default list of shopify is Customer accepts email marketing, I want to add list of email that want a discount code.

This is the default email subscribe of shopify. But I didn't see anything here that will add to another email List

  {%- assign formId = 'Contact_' | append: section.id -%}
    {% form 'customer', id: formId, novalidate: 'novalidate', class: 'contact-form form-single-field' %}
      {%- if form.posted_successfully? -%}
        <p class="form-message form-message--success" tabindex="-1" data-form-status>
          {{ 'general.newsletter_form.confirmation' | t }}
        </p>
      {%- endif -%}
      <input type="hidden" name="contact[tags]" value="newsletter">
      <div class="input-group {% if form.errors %} input-group--error{% endif %} emailInputSection">
        <input type="email"
          name="contact[email]"
          id="{{ formId }}-email"
          class="input-group__field{% if form.errors %} input--error{% endif %}"
          value="{{ form.email }}"
          placeholder="{{ 'general.newsletter_form.email_placeholder' | t }}"
          aria-label="{{ 'general.newsletter_form.email_placeholder' | t }}"
          aria-required="true"
          autocorrect="off"
          autocapitalize="off"
          {% if form.errors %}
            aria-invalid="true"
            aria-describedby="{{ formId }}-email-error"
            data-form-status
          {% endif %}
          >
        <span class="input-group__btn">
          <button type="submit" class="btn" name="commit" id="Subscribe">
            <span>{{ 'general.newsletter_form.submit' | t }}</span>
          </button>
        </span>
      </div>
      {%- if form.errors contains 'email' -%}
        <span id="{{ formId }}-email-error" class="input-error-message">
          {% include 'icon-error' %} {{ form.errors.translated_fields['email'] | capitalize }} {{ form.errors.messages['email'] }}.
        </span>
      {%- endif -%}
    {% endform %}

I need some helpful advice what to do to get this done.

Ad

Answer

This is only a way of grouping customers by tags in Shopify admin. Here, your form add a tag "Newsletter" to subscribed customer.

So you might replace this line:

<input type="hidden" name="contact[tags]" value="newsletter">

By this one:

<input type="hidden" name="contact[tags]" value="discount">

Then in your admin interface, you will be able to create a group of customers with tag "Discount" and you get your list.

Better: when you will create a new discount code, you can assign it to this group :).

Ad
source: stackoverflow.com
Ad