Mechanic is a development and ecommerce automation platform for Shopify. :)
This task wait for a configurable number of days (or hours!) after an order placed, and – if the order is still unpaid – emails the customer, and optionally adds a tag to the order. This task only sends one email – it does not send repeating reminders.
Runs Occurs whenever an order is created, with a 7 day delay. Configuration includes email subject, email body, tag to add to the order, number of days to wait, and use hours instead of days.
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?)
shopify/orders/create+{{ options.number_of_days_to_wait__number_required | default: 7 }}.{% if options.use_hours_instead_of_days__boolean %}hours{% else %}days{% endif %}
{% assign email_subject = options.email_subject__required %} {% assign email_body = options.email_body__multiline_required %} {% assign tag_to_add_to_the_order = options.tag_to_add_to_the_order %} {% comment %} -- requery the order since a delay is typically configured in the task {% endcomment %} {% capture query %} query { order(id: {{ order.admin_graphql_api_id | json }}) { id email cancelledAt displayFinancialStatus tags } } {% endcapture %} {% assign result = query | shopify %} {% if event.preview %} {% capture result_json %} { "data": { "order": { "id": "gid://shopify/Order/1234567890", "email": "sample@example.com", "displayFinancialStatus": "PENDING" } } } {% endcapture %} {% assign result = result_json | parse_json %} {% endif %} {% assign order = result.data.order %} {% comment %} -- don't send notification email if the order has no email, has been cancelled, or is no longer pending {% endcomment %} {% if order.email == blank or order.cancelledAt != blank or order.displayFinancialStatus != "PENDING" %} {% break %} {% endif %} {% comment %} -- send reminder email and tag the order if that option is configured {% endcomment %} {% action "email" %} { "to": {{ order.email | json }}, "subject": {{ email_subject | json }}, "body": {{ email_body | strip | newline_to_br | json }}, "reply_to": {{ shop.customer_email | json }}, "from_display_name": {{ shop.name | json }} } {% endaction %} {% if tag_to_add_to_the_order != blank %} {% action "shopify" %} mutation { tagsAdd( id: {{ order.id | json }} tags: {{ tag_to_add_to_the_order | json }} ) { userErrors { field message } } } {% endaction %} {% endif %}
Don't forget! Order #{{ order.order_number }} still needs to be paid
Hi there, Your payment is still required! Please get in touch at {{ shop.customer_email }} to proceed. Thanks, {{ shop.name }}
7