Mechanic Get Mechanic
Task library

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.

Try this task

When it runs

Occurs whenever an order is fulfilled, with a 7 day delay

What you choose

  • Days to wait before emailing
  • Only send to customers who have accepted marketing
  • Customer tag to add after sending
Show 4 more
  • Ignore customers having this tag
  • Ignore orders having this tag
  • Email subject
  • Email body

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.

Task code and subscriptions

You can edit the Liquid code after installing this task. View on GitHub or ask a question in the Mechanic Slack community.

Subscriptions

shopify/orders/fulfilled+{{ options.days_to_wait_before_emailing__number_required | default: 7 }}.days
How task subscriptions work

Option types and flags

Task 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 %}
Mechanic Liquid reference

Default option values

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 }}