Zapier has become my answer to any quick project need, and a must-have for hack days. It’s “If This Then That” but dramatically more powerful, and for many more services—especially the tools we use at work. And it lets me scratch an itch without having to beg a developer to do it for me.
Here are a few of my favorite problem solvers from the past year.
1. Gmail -> HubSpot
Outcome: When replying to someone who wants to stay in touch, I can say “I’ll add you to our newsletter” and actually do so with a couple keystrokes.
How: In Gmail create a label called “newsletter”.
In Zapier, trigger on any new email in a thread. Mailbox/tag name is your new label. Search String is “from:<your email address” (without quotes). {{The Email}} to be added as a HubSpot Contact is {{To Address}}.
To trigger the Zap, apply the label to the thread.
2. Web Hook (Retrieve Poll) -> Email
Outcome: When a particular phrase is mentioned on Hacker News, email me.
How: There’s a third-party site that provides full-text search for Hacker News. You can poll it with your search. The Web hook URL is: http://hn.algolia.com/api/v1/search_by_date?query=“<search term>”&tags=comment
Key: hits
My email looks like this:
Subject: Hacker News mention of <phrase>
{{story_title}}
{{comment_text}}
{{author}}
https://news.ycombinator.com/item?id={{objectID}}
3. RSS -> Buffer
Outcome: When new jobs are posted in Resumator (our applicant tracking system), they are tweeted out on our jobs-specific Twitter feed, @knewton_jobs.
How: Resumator provides an XML feed. A web developer on my team built a simple script that translates it into a proper RSS feed. Zapier then posts new entries to Buffer, which sends the tweets.
Pretty straightforward. There are two delays: (1) Resumator only updates their XML feed once/day, (2) Buffer by nature won’t post things immediately. The Buffer delay is helpful because we don’t know exactly when Resumator will update its feed and we want tweets to go out when people are likely to see them (e.g., weekday mornings).
4. Gmail -> HipChat
Outcome: when someone (especially our security team) sends a critical email, they can include a keyword in the subject line will automatically blast a notification to everyone in chat.
How: We use Hubot, and the account has its own email address. We use that address for this Zap. First, we make sure it’s a member of any groups that are likely to need this email relayed to chat, such as all of the tech organization or the entire company.
Next, we create a Zap for every particular list mapped to a specific HipChat room. Here are the Zap’s Gmail rules:
Mailbox/tag name: INBOX
Search String: list:<group email address> (subject:“Broadcast” OR subject:“Outage” OR subject:“Alert”)
HipChat rules:
Room: <room of choice>
From: {{from_name}}
Message: @here Email Subject: {{subject}} - {{message_url}}
Notify: yes
Message format: text
(Note: the @here notification does not work if the message is sent in HTML format)
The {{message_url}} is the email’s unique URL in Gmail. Assuming the recipient is logged into the relevant Gmail account, clicking the link should open up the email directly.
If that turns out to be buggy because people are logged into multiple Gmail accounts, you can instead provide a link to a Gmail search of the message’s ID (the last part of message_url), which will return results showing only the matching message.
5. Web Hook router (Web Hook -> Web Hook -> many HipChat rooms)
Outcome: Notifications from our custom build system are filtered for matching rules and send to various HipChat rooms with color coding for success or failure. By doing it in Zapier we were able to test the idea, deploy, and validate, to the point where additional teams have started asking for them.
How: I created two Web Hook -> HipChat Zaps for every type of alert that needed to get sent, one for success messages (green HipChat background), one for failures (red background).
Each Zap filters for the message it needs (any necessary environment/stack restrictions plus a success message or lack thereof) and fires its notification.
Unfortunately, each Zap automatically assigns its own Web Hook as the starting point. Rather than have the developer keep adding a new endpoint for every new Zap I whip up, I created a Web Hook -> Web Hook Zap that acts like a router. The developer wired up the first POST endpoint. The second part of that “router” Zap relays the POSt message to _every other subsequent Zap_ I create.
So whereas a single Zapier Web Hook looks like this: https://zapier.com/hooks/catch/akfas903/
You can hit many of that once like this:
https://zapier.com/hooks/catch/fs9d8asff,asfjaf8,af89awf,asdf89/
Payload Type: form
(Those are all fake values. Don’t hit them!)