Tags: CSV, Email, Export, Orders
Use this task to generate and email a CSV of orders, including one row per line item. Filter with a search query or by tags, and auto-tag orders as they're exported. Run the export on demand, and/or nightly. This task is also useful as a template for further development.
- View in the task library: tasks.mechanic.dev/email-a-csv-export-of-orders
- Task JSON, for direct import: task.json
- Preview task code: script.liquid
{
"search_query_for_orders": "fulfillment_status:unshipped",
"ignore_orders_with_this_tag": "exported",
"add_this_tag_after_export": "exported",
"export_email_recipient__email_required": "",
"export_email_subject__required": "Unfulfilled orders for {{ \"now\" | date: \"%Y-%m-%d\" }}",
"export_email_body__required_multiline": "Hello,\n\nPlease see the attachment for currently unfulfilled orders.\n\nThanks,\nMechanic, for {{ shop.name }}",
"export_csv_filename__required": "unfulfilled-orders-{{ \"now\" | date: \"%Y-%m-%d\" }}",
"run_export_nightly__boolean": false
}
Learn about task options in Mechanic
mechanic/user/trigger
{% if options.run_export_nightly__boolean %}mechanic/scheduler/daily{% endif %}
Learn about event subscriptions in Mechanic
Use this task to generate and email a CSV of orders, including one row per line item. Filter with a search query or by tags, and auto-tag orders as they're exported. Run the export on demand, and/or nightly. This task is also useful as a template for further development.
Find this task in the library at tasks.mechanic.dev, and use the "Try this task" button. Or, import this task's JSON export – see Importing and exporting tasks to learn how imports work.
Found a bug? Got an improvement to add? Start here: ../../CONTRIBUTING.md.
Submit your task requests for consideration by the Mechanic community, and they may be chosen for development and inclusion in the task library!