Using Zapier with Drafts

guide
zapier

#1

image

Zapier is an online automation service which integrates with hundreds of services and APIs. While Drafts has great direct integration with many services, Zapier supports many more. If there are services Drafts does not directly support, Zapier is a great way to incorporate them in your Drafts workflow. This includes Facebook, LinkedIn, Office365 apps, and many more.

Zapier “Zaps” are automation tools setup with a trigger and and action. What all you can do with Zapier is well beyond this guide, but know that Zaps can be triggered by Drafts in two ways.

Webhook Triggers

Zaps can be configured with a Catch Hook trigger, which creates a unique URL to send information to and trigger the Zap. This is the best way to integrate with Drafts, because it allows drafts to set multiple values easily which can be inserted into the Zap action.

These example action below shows how to trigger a zap via webhook:

  • Zapier: Catch Hook Example using Credentials
    • This example uses Drafts Credentials to store the catch hook URL. The first time you run it you will be prompted to enter the hook URL which can be pasted from the Zapier site, and it will be remember for future use. To setup multiple zaps, this action can be duplicated an the “zapIdentifier” in the first script step changes to a unique value for each zap you want to target.
  • Zapier: Catch Hook with Hard Coded URL
    • This is same same as above, but with the hook URL hard-coded as a variable in the script.

After installing this action, the hookURL variable at the top of the script can be changed to match the unique URL assigned to one of your personal Zaps. The example sends “title”, “body” and “content” (full draft) to the Zap as elements that can be inserted into an action.

After configuring this to point to your Zap, just tap the action and the information will be sent to Zapier and the zap run. The action can be duplicated and different Zap URLs setup to trigger additional zaps.

Email Triggers

Zapier also support triggering zap via email triggers. When a zap is configured for email, it gets assigned a unique incoming email address. A Drafts mail action step can then be configured to send to that email address and trigger the action.

In general, unless you have a specific reason, we recommend you use Webhook triggers because they directly communicate with Zapier and will be more immediate as a result. Email triggers may be delayed by mail delivery time, etc.