Mechanic is a development and ecommerce automation platform for Shopify. :)
This task watches for newly-paid orders. When an order contains a certain line item, this task retrieves a file from the URL of your choice, and emails that file to the customer. Because URLs are easier to share, this makes for a safer way to distribute downloadable materials.
Runs Occurs whenever an order is paid. Configuration includes required line item title, email subject, email body, attachment filename, and attachment url.
This task watches for newly-paid orders. When an order contains a certain line item, this task retrieves a file from the URL of your choice, and emails that file to the customer. Because URLs are easier to share, this makes for a safer way to distribute downloadable materials.
Shopify allows file uploads via the "Files" page. Once uploaded, you'll receive a URL which can be used for this task. Learn how to upload files to Shopify.
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/paid
{% if event.preview %} {% capture order_json %} { "line_items": [ { "title": {{ options.required_line_item_title__required | json }} } ] } {% endcapture %} {% assign order = order_json | parse_json %} {% endif %} {% assign line_item_titles = order.line_items | map: "title" %} {% if line_item_titles contains options.required_line_item_title__required %} {% action "email" %} { "to": {{ order.email | json }}, "subject": {{ options.email_subject__required | json }}, "body": {{ options.email_body__required_multiline | newline_to_br | json }}, "reply_to": {{ shop.customer_email | json }}, "from_display_name": {{ shop.name | json }}, "attachments": { {{ options.attachment_filename__required | json }}: { "url": {{ options.attachment_url__required | json }} } } } {% endaction %} {% endif %}
Course
Here's your purchased course! (Order {{ order.name }})
Hey there! Thanks for purchasing this course. You'll find the PDF attached to this email. :) Thanks, {{ shop.name }}
Course for order {{ order.name }}.pdf
https://example.com/course.pdf