Ask for reviews a week after order fulfillment, with Mechanic.

Mechanic is a development and ecommerce automation platform for Shopify. :)

Ask for reviews a week after order fulfillment

Follow up with your customers automatically, and establish the purchase -> earn-reviews -> attract-customers cycle. This task comes prefilled with a friendly, customizable email that gives the customer direct links to their purchases on your website, where they can leave a review using your existing review system.

Runs Occurs whenever an order is fulfilled, with a 7 day delay. Configuration includes days to wait before emailing, only send to customers who have accepted marketing, customer tag to add after sending, ignore customers having this tag, ignore orders having this tag, email subject, and email body.

15-day free trial – unlimited tasks

Documentation

Follow up with your customers automatically, and establish the purchase -> earn-reviews -> attract-customers cycle. This task comes prefilled with a friendly, customizable email that gives the customer direct links to their purchases on your website, where they can leave a review using your existing review system.

Developer details

Mechanic is designed to benefit everybody: merchants, customers, developers, agencies, Shopifolks, everybody.

That’s why we make it easy to configure automation without code, why we make it easy to tweak the underlying code once tasks are installed, and why we publish it all here for everyone to learn from.

(By the way, have you seen our documentation? Have you joined the Slack community?)

Open source
View on GitHub to contribute to this task
Subscriptions
shopify/orders/fulfilled+{{ options.days_to_wait_before_emailing__number_required | default: 7 }}.days
Tasks use subscriptions to sign up for specific kinds of events. Learn more
Options
days to wait before emailing (number, required), only send to customers who have accepted marketing (boolean), customer tag to add after sending, ignore customers having this tag, ignore orders having this tag, email subject (required), email body (multiline, required)
Code
{% comment %}
  Option order:
  {{ options.days_to_wait_before_emailing__number_required }}
  {{ options.only_send_to_customers_who_have_accepted_marketing__boolean }}
  {{ options.customer_tag_to_add_after_sending }}
  {{ options.ignore_customers_having_this_tag }}
  {{ options.ignore_orders_having_this_tag }}
  {{ options.email_subject__required }}
  {{ options.email_body__multiline_required }}
{% endcomment %}

{% assign send_email = true %}
{% assign order = order.reload %}

{% if event.preview %}
  {% capture order_json %}
    {
      "line_items": [
        {
          "product_exists": true
        }
      ],
      "email": "customer@example.com",
      "tags": "",
      "customer": {
        "admin_graphql_api_id": "gid://shopify/Customer/1234567890",
        "tags": "",
        "email_marketing_consent": {
          "state": "subscribed"
        }
      }
    }
  {% endcapture %}

  {% assign order = order_json | parse_json %}
{% endif %}

{% assign has_product = false %}
{% for line_item in order.line_items %}
  {% if line_item.product_exists %}
    {% assign has_product = true %}
    {% break %}
  {% endif %}
{% endfor %}

{% if has_product != true %}
  {% log "Order has no products; skipping" %}
  {% assign send_email = false %}
{% endif %}

{% if order.email == blank %}
  {% assign send_email = false %}
  {% log "Order has no email on file; skipping" %}
{% endif %}

{% if options.ignore_orders_having_this_tag != blank %}
  {% assign order_tags = order.tags | split: ", " %}

  {% if order_tags contains options.ignore_orders_having_this_tag %}
    {% log message: "Order is currently tagged with the tag to ignore", tag: options.ignore_orders_having_this_tag %}
    {% assign send_email = false %}
  {% endif %}
{% endif %}

{% if order.customer and options.ignore_customers_having_this_tag != blank %}
  {% assign customer_tags = order.customer.tags | split: ", " %}

  {% if customer_tags contains options.ignore_customers_having_this_tag %}
    {% log message: "Customer is currently tagged with the tag to ignore", tag: options.ignore_customers_having_this_tag %}
    {% assign send_email = false %}
  {% endif %}
{% endif %}

{% if options.only_send_to_customers_who_have_accepted_marketing__boolean %}
  {% if order.customer.email_marketing_consent.state != "subscribed" %}
    {% log "This customer does not accept marketing." %}
    {% assign send_email = false %}
  {% endif %}
{% endif %}

{% if send_email %}
  {% action "email" %}
    {
      "to": {{ order.email | json }},
      "subject": {{ options.email_subject__required | json }},
      "body": {{ options.email_body__multiline_required | strip | newline_to_br | json }},
      "reply_to": {{ shop.customer_email | json }},
      "from_display_name": {{ shop.name | json }}
    }
  {% endaction %}

  {% if order.customer and options.customer_tag_to_add_after_sending != blank %}
    {% action "shopify" %}
      mutation {
        tagsAdd(
          id: {{ order.customer.admin_graphql_api_id | json }}
          tags: {{ options.customer_tag_to_add_after_sending | json }}
        ) {
          userErrors {
            field
            message
          }
        }
      }
    {% endaction %}
  {% endif %}
{% endif %}
Task code is written in Mechanic Liquid, an extension of open-source Liquid enhanced for automation. Learn more
Defaults
Days to wait before emailing
7
Only send to customers who have accepted marketing
true
Email subject
Will you review your order? :)
Email body
Hello,

Thanks for ordering from {{ shop.name }}!

Your item{% if order.line_items.size > 1 %}s{% endif %} arrived a week ago, and we have a quick question: <b>will you review your purchase?</b>

Here {% if order.line_items.size > 1 %}are direct links{% else %}is a direct link{% endif %}, to make this easy for you:
<ul>{% for line_item in order.line_items %}{% if line_item.product_exists or event.preview %}<li><a href="https://{{ shop.domain }}/products/{{ line_item.product.handle }}">{{ line_item.name }}</a></li>{% endif %}{% endfor %}</ul>
Thanks so much!

Sincerely,
The team at {{ shop.name }}