【问题标题】:Shopify Custom Email ModuleShopify 自定义电子邮件模块
【发布时间】:2016-09-22 18:08:04
【问题描述】:

如何从 Shopify 表单中传递可变数据(我为页面制作了一个模板,其中包含一个表单,要求客户选择一种产品并输入名称、电子邮件、地址等)作为电子邮件发送?是否有可能获取数据然后将其传递给某些第三方应用程序,例如 Mailchimp,而该第三方应用程序会通过电子邮件将其发送给包含数据的客户?

简而言之,我的问题是: 如何创建自定义表单,然后将数据通过电子邮件发送给客户?

【问题讨论】:

  • 您好,您可以在提交表单时使用javascript/ajax将表单数据提交给第三方应用程序。给我您的表单网址,我会尽力提供帮助。
  • @MashR。感谢您的评论!我会尝试通过 Skype 与您联系。谢谢!

标签: email shopify


【解决方案1】:

我使用了customized ajaxchimp jquery 插件将shopify 联系表与mailchimp 集成在一起。

{% form 'contact' %} {% comment %} Successful message {% endcomment %} {% if form.posted_successfully? %}
<p class="note form-success">
  {{ 'contact.form.post_success' | t }}
</p>
{% endif %} {{ form.errors | default_errors }}

<div class="grid grid--small">
  <div class="grid__item large--one-half">
    <label for="ContactFormName" class="hidden-label">{{ 'contact.form.name' | t }}</label>
    <input type="text" id="ContactFormName" class="input-full" name="contact[name]" placeholder="{{ 'contact.form.name' | t }}" autocapitalize="words" value="{% if form.name %}{{ form.name }}{% elsif customer %}{{ customer.name }}{% endif %}">
  </div>

  <div class="grid__item large--one-half">
    <label for="ContactFormEmail" class="hidden-label">{{ 'contact.form.email' | t }}</label>
    <input type="email" id="ContactFormEmail" class="input-full" name="contact[email]" placeholder="{{ 'contact.form.email' | t }}" autocorrect="off" autocapitalize="off" value="{% if form.email %}{{ form.email }}{% elsif customer %}{{ customer.email }}{% endif %}">
    <input type="hidden" id="ContactFormHidden" name="contact[email]" value="{% if form.email %}{{ form.email }}{% elsif customer %}{{ customer.email }}{% endif %}">
  </div>
</div>

<label for="ContactFormPhone" class="hidden-label">{{ 'contact.form.phone' | t }}</label>
<input type="tel" id="ContactFormPhone" class="input-full" name="contact[phone]" placeholder="{{ 'contact.form.phone' | t }}" pattern="[0-9\-]*" value="{% if form.phone %}{{ form.phone }}{% elsif customer %}{{ customer.phone }}{% endif %}">

<label for="ContactFormMessage" class="hidden-label">{{ 'contact.form.message' | t }}</label>
<textarea rows="10" id="ContactFormMessage" class="input-full" name="contact[body]" placeholder="{{ 'contact.form.message' | t }}">{% if form.body %}{{ form.body }}{% endif %}</textarea>

<input type="submit" class="btn right" value="{{ 'contact.form.send' | t }}">
<label for="mc-email"></label>
{% endform %} 

{{ 'mailchimp.js' | asset_url | script_tag }}

<script>
  $('#ContactFormEmail').change(function() {
    var email = $(this).val();
    $('#ContactFormHidden').val(email);
  });
</script>

<script>
  $('#contact_form').ajaxChimp({
    url: 'https://cyberite.us4.list-manage.com/subscribe/post?u=858232f1e77dc411cb2405b5f&id=502f26188f',
  });
</script>

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2017-12-19
    • 2014-03-31
    • 1970-01-01
    • 2020-08-31
    • 1970-01-01
    • 1970-01-01
    • 2020-03-11
    • 1970-01-01
    相关资源
    最近更新 更多