How to get IFTTT to post @ replies on Twitter

ED: This method was working at date of publishing. If it ever stops working at any given time, please do let me know in the comments and I shall see if I can fix it. Cheers.

Back in my link building days, I used to use IFTTT a lot. In fact I even wrote a recipe workaround via RSS feeds back in 2012 when Twitter killed IFTTT’s API access.

Sadly since those days finished, it’s been limited to auto sharing my Instagram posts to Twitter, and notifying me via email when a pie shop in Norwich posts its weekly special to Facebook.

In fact, it’s been so long since I logged into my IFTTT account that the last time I did Applets were still called “Recipes”.

However, that changed this week when I found myself at a wit’s end and having a stupid idea to entertain a handful of people. I’m a massive Simpsons fan (up to the seasons in double figures anyway) and I spend a large chunk of my working day sat next to Andrew Smith quoting it. This inspired me one evening to create a new Twitter bot. The premise was simple; an account that simply posted “Lisa needs braces” and “DENTAL PLAN” over and over again.

Pretty Simple, right? Set up some ‘Time and date’ triggers alongside some scheduled tweets with varied characters to ensure they don’t get rejected as duplicate tweets, and BOOM! My Simpsons Twitter bot was alive (as of time of writing of course, it may have been killed by Twitter by the time you read this).

But enough of that story, you’re here to learn how to @ reply on Twitter using IFTTT, yeah?

The one thing I noticed, venturing into my first foray of IFTTT and Twitter for the first time in a couple of years, was the lack of ability to set up an Applet that would @ reply to other accounts automatically based on a trigger. If you try and set this up using the Twitter IFTTT API with “@{{UserName}}” as an ingredient the result is the “@” character being stripped from the tweet, thus posting the username as unlinked text. It seemed to be a common problem when I Googled for a solution with no answer too.

I wanted my bot to have the ability to respond to anyone @ mentioning the account, as well as tweet people mentioning the phrases “Lisa needs braces” or “Dental plan.” I had a suspicion the stripping of the “@” in tweets was only working because of the Twitter IFTTT API itself and that it was not something specific to all APIs. I decided to test a work around and… Lo and behold, it bloody worked!

And even better news for you, this work around is really easy and takes only a few minutes to set up.

For this you will need…

  • An IFTTT account set up with a Gmail address.
  • A Twitter account linked to your IFTTT account.
  • A Gmail account linked to your IFTTT account.

Step 1…

Set up an applet with ‘Twitter’ as your ‘This’ using either ‘New mention of you’ or ‘New tweet from search’ and your preferred search term, depending on what you want to respond to.

Step 2…

Select ‘Email’ as your ‘That’ and get IFTTT to send you an email every time someone does your ‘This’ action on Twitter.

Make the subject line “@{{UserName}}” and whatever you want your response on Twitter to be. This can be made up of variables such as “{{text}}” (which quotes the tweet that triggers the Applet) or text of your choosing.

On top of this, make the message body contain text that is unlikely to appear in your inbox from any other email and trigger it. Using a password generator can be useful here, you can see an example below.

(UPDATE 26TH APRIL 2018: After a DM on Twitter from George Stone stating he was having issues getting the second Applet to work, I discovered using special characters in the body text may cause a triggering issue with this method. Please ensure you only use numbers and letters in your body text for this section, regardless of what the screen grab above contains!)

Once you are done with this, create the action and confirm your applet as complete.

Step 3…

Now you need to create a second Applet that will trigger a tweet from your emails. Create another new Applet and use ‘Gmail’ for your ‘This’. Select the option ‘New email in inbox from search’ and enter the text you wrote in the ‘Email’ trigger body section in step 2 in quotation marks.

Step 4…

Now select ‘Twitter’ for your ‘That’ and choose ‘Post a tweet’. Simply enter “{{Subject}}” and finish off creating the action.

And that’s it!

You should now have a Twitter account able to @ mention people based on your chosen Twitter criteria. I would recommend using another Twitter account to test it’s all working and make any tweaks to your Applets if needed.

The downsides

The only potential negatives I’ve seen from this method are as follows, so be warned…

  1. The Applets do not directly respond to the tweets that trigger it in feed format. Even though it will @ mention the user, it will be as a standalone tweet and not as a direct response to the tweet that triggered it.
  2. I do believe Twitter’s spam filter for removing potential bots from users’ notifications feeds is better than it used to be. I’ve had a few moments on my personal Twitter account where I’ve tested it, and although the bot has responded perfectly, the tweet has not shown up in my notifications. My Simpsons bot does end up in some people’s notifications as I’ve had others engage by replying/Retweeting/favouriting, but I’m not sure what the ratio is for this. I would imagine Twitter filters this stuff on a case-by-case basis depending on the signals the Twitter account gives off in terms of being a real user or a bot, so I’d guess it comes down to the variations of your tweets in general and how aggressive it is in @ mentioning other accounts.
  3. For the second Applet outlined in this method to work, you need all emails that trigger a tweet to land in your inbox. If you filter them out to automatically delete or move to another folder it won’t work. This in turn means you’ll end up with emails you have no intention to read filling your inbox. I’d recommend setting up your recipes using a Gmail account solely for the purpose of this, that won’t get in the way of important emails you actually want/need to read.

I’d also like to note that I have used the above method to have a bit of light-hearted fun and entertain the odd Simpsons fan on Twitter. I do not condone or encourage using this method for anything intrusive, spammy, abusive or downright wrong. TL;DR – don’t be a prick.

Happy IFTTing and all that.