Email customer when their order is paid, with Mechanic.

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

Email customer when their order is paid

Quickly send a thank-you email (or any other sort of follow-up email) to your customers, as soon as their order is paid. (Optionally, require one or more order tags to be present, in order for the email to be sent.) And it's super easy to add a delay – set the task to subscribe "shopify/orders/paid+2.days" or "shopify/orders/paid+1.week" instead to create a thoughtful just-checking-back-in-with-you message. :)

Runs Occurs whenever an order is paid. Configuration includes required order tags at the time of payment, email subject, and email body.

15-day free trial – unlimited tasks

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/paid
Tasks use subscriptions to sign up for specific kinds of events. Learn more
Options
required order tags at the time of payment (array), email subject (required), email body (multiline, required)
Code
{% if event.preview %}
  {% assign order = hash %}
  {% assign order["email"] = "customer@example.com" %}
  {% assign order["tags"] = options.required_order_tags_at_the_time_of_payment__array | join: ", " %}
{% endif %}

{% assign order_qualifies = true %}

{% if order.email == blank %}
  {% log message: "Order is missing an email address; skipping" %}
  {% assign order_qualifies = false %}
{% endif %}

{% if options.required_order_tags_at_the_time_of_payment__array != blank %}
  {% assign order_tags = order.tags | split: ", " %}
  {% for required_tag in options.required_order_tags_at_the_time_of_payment__array %}
    {% unless order_tags contains required_tag %}
      {% log message: "Order is missing a required tag; skipping", missing_tag: required_tag, order_tags: order_tags %}
      {% assign order_qualifies = false %}
    {% endunless %}
  {% endfor %}
{% endif %}

{% if order_qualifies %}
  {% 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 %}
{% endif %}
Task code is written in Mechanic Liquid, an extension of open-source Liquid enhanced for automation. Learn more
Defaults
Email subject
Order #{{ order.order_number }} is paid - thank you!