Generate zip files for FTP or email

Mechanic's file processing now supports generating zip files, with optional password protection.

This is a part of our standard file processing, which means this feature is available for both "email" and "ftp" actions. And, because you can define the contents of a zip file in Mechanic's standard form, this means that you can generate PDF files, which are then zipped and password-protected, before emailing them or uploading them to an SFTP/FTP server.

Read more:
Documentation: Actions / Generating files

Standardized file generators for "email" and "ftp" actions

While already available for the "email" action, the ability to generate PDFs is now available for the "ftp" action as well. The same file processing is used for both actions, allowing you to be more flexible about how you generate and deliver your material.

Read more:
Documentation: Actions / Generating files

This comes with a small change to the "ftp" action: rather than defining a single file to upload, you can now define as many files as you like, by using a new "uploads" option.

Before:

{% action "ftp" %}
  {
    "host": "example.com",
    "port": 21,
    "user": "anonymous",
    "password": null,
    "put": {
      "mode": "ascii",
      "filename": "example.txt",
      "data": "hello world!"
    }
  }
{% endaction %}

After:

{% action "ftp" %}
  {
    "host": "example.com",
    "port": 21,
    "user": "anonymous",
    "password": null,
    "uploads": {
      "example.txt": "hello world!"
    }
  }
{% endaction %}

The original usage will still be supported, as legacy.

Read more:
Documentation: Actions / The "ftp" action

Tasks: view version history

While Mechanic has always tracked changes to tasks, we now offer this information to users. You can use the version history to see what changed in a task, and when it changed. And, you can restore any older version, allowing you to safely test changes, knowing that you can roll back at any time.

To learn more:
Documentation: Version history

Event action: specify task_ids

When writing task scripts that include an "event" action, you may now include a "task_ids" option, specifying a whitelist of tasks that are allowed to respond to the new event.

Used in concert with the {{ task.id }} variable, you may now write tasks that queue up future work for themselves, guaranteeing that no other tasks will respond to your events.

To learn more:
Documentation: The "event" action

For a working example:
Task: Email vendors when their products are ordered

Cache action: positional arguments, new operations

The "cache" action now supports positional arguments, and four new operations: incr, incrby, decr, and decrby.

The existing usage style remains supported. Together, these updates mean that these two styles are equivalent:

{% action "cache" %}
  {
    "incrby": {
      "key": "order_count",
      "increment": 10
    }
  }
{% endaction %}

{% action "cache" "incrby", "order_count", 10 %}

To learn more:
Documentation: Cache

Liquid: new "browser" filter

We've introduced a new filter, called "browser", for converting user agent strings into more practically useful browser data.

To learn more:
Documentation: Filters / browser

For a working example:
Task: Auto-tag new online orders by web browser

Updates to email policy

We've documented a policy we inherit from Postmark, our email provider: only transactional email is permitted to be sent from our platform. Bulk email is not permitted.

In the rare circumstances that an unsubscribe link is appropriate for a Mechanic-powered email, you can now use {{ customer.unsubscribe_url }} in your task script.

Read more:
What kind of email can I send with Mechanic?
Documentation on the customer object

Choose your Shopify API version, per task

Mechanic now supports selecting your Shopify API version on a task-by-task basis, allowing you to target your GraphQL and REST queries appropriately. Tasks will always default to targeting the latest stable version of the Shopify API.

To learn more:
Choosing a Shopify API version

Liquid: New "csv" filter

We've introduced a new "csv" filter, which formats two-dimensional arrays as a CSV string. This is particularly useful when composing email reports.

Learn more:
Filters / CSV

Liquid: Update to "shopify" action

In addition to existing usages, the action tag now accepts a plain GraphQL query when used with the "shopify" action.

For example, this usage is now valid:

{% action "shopify" %}
  mutation {
    customerCreate(
      input: {
        email: "test@example.com"
      }
    ) {
      customer {
        id
      }
    }
  }
{% endaction %}

Supplying a query as a string variable is still supported as well:

{% capture query %}
  mutation {
    customerCreate(
      input: {
        email: "test@example.com"
      }
    ) {
      customer {
        id
      }
    }
  }
{% endaction %}

{% action "shopify" query %}

No published changelogs yet.

Surely Mechanic will start publishing changelogs very soon.

Check out our other public changelogs: Buffer, Mention, Respond by Buffer, JSFiddle, Olark, Droplr, Piwik Pro, Prott, Ustream, ViralSweep, StartupThreads, Userlike, Unixstickers, Survicate, Envoy, Gmelius, CodeTree