Article

Disqus: How-To notify your authors of new comments

The commenting platform Disqus is really easy to get up and running and a great addtion to your blog.  However, there was one feature I needed for Inside the Agency that didn't appear to be as simple as it sounded.

disqus_logo_-_white_on_blue_background (1).png

An implied feature of any collaborative site (including Inside the Agency) is that each author who contributes to the site is notified of any new comments that were posted on their articles, but this is not a feature that Disqus handles directly.  Disqus can send notifications to each Disqus moderator when a new comment is posted but often the author is not a Disqus moderator so sending author notifications has to be handled outside of Disqus.

Disqus does provided you with a onNewComment callback which means you can notify the author of a new comment yourself and gives you a lot more control over what happens when new comment is posted.

The example below shows how you could configure the onNewComment callback to make an AJAX call to /comments/new and pass in the URL of the page the event was fired from.

Github Gist Placeholder

This example can be easily tweaked to use alternative ways of identifying which article the event has been fired from i.e. via a data attribute holding the article id.

Github Gist Placeholder

With the AJAX call in place you can now build the functionality behind /comments/new in your backend language (PHP in our case), retrieve the article that fired the event based on the data passed in the AJAX call, locate the author and then send an email to notify them of the new comment.

Adding this will help keep everyone happy.  Your authors will now know when a new comment is left and you will receive a higher engagement on the articles on your site as the authors and commenters can respond to one another in a timely manner.

Do you use Disqus as your comment platform or can you suggest a better alternative?  Have you had any additional features you have had to build in? Let us know in the comments below.

me.jpeg

I am a web developer specialising in web driven applications using PHP, MySQL, Symfony and Zend and I am currently working for the The Drum in Glasgow, Scotland.

Most days I can be found frantically coding away with EuroDance in my ears and consuming what I hope to be a never ending supply of coffee... happy days!

Want more like this?

Keep up-to-date with latest news from Inside the Agency using any of the following services

Recent articles

The Iron Triangle - How does motivation emphasis create an agency environment?

I remember when I first heard about the Iron Triangle. It sounded sinister, Evil Empire like, and not really something I could embrace in my fluffy idealistic agency brain. Just to be clear in this article I am talking about the Project Management version, not the US political system version… which is sinister and is just like the Evil Empire.

ITA-motivation-illustration-20151120.jpg

Back then I was speaking to my then boss, a man who I credit with opening my eyes to a great deal to how an agency works and, more importantly, how it should work. He was explaining in typically simple eloquence, how he wanted us to set expectation with clients. 

Read more

The Adblock Wars - Stop blaming the victim!

Much to the dismay of the advertising and publishing industry, Adblock is indeed here to stay. But, what is the industry doing about it? For the most part, pointing the finger and accusing the end user of underhanded tactics. To that I say: Pot, meet Kettle.

ad-blocking-article

Over the last few months I have noticed an increasing number of articles surround Adblock usage, most of which are coming from advertisers and publishers perspective.  Within these articles the underlying theme is that Adblock is evil and people using it are:

Read more

Content is a very lonely king (and he needs some pants)

I was once told that If you put a £5 note for sale in the window, you can sell it for £5 or maybe even more, but if you put it way at the back of the shop, hidden away and try to sell it for 50p, it still won't sell.

king_of_no_pants_by_pixiepirate.jpg

Lesson:  No matter how good the product is, if it's not where your customers can see it then it's worthless. 

Read more

Advertisement

Digital Ocean

Chris's Reading List

JAXenter

Self-promotion is a skill, but is that the skill you're looking for? - JAXenter

Do you want to hire somebody that's good at self-promotion, or are you looking for a certain skill-set? Perhaps you need to shape your job spec differently. Read more

TechCrunch

TechCrunch

When Crowdfunding Fails The Backers Are Left With No Way Out

A few years ago an enterprising programmer dug through Kickstarter's data to figure out how many failed projects there really were. Thanks to a trick in the.. Read more

Business Insider

A programmer wrote scripts to secretly automate a lot of his job — and email his wife and make a latte

There's a hilarious project that's gone viral on GitHub that consists of a bunch of software scripts that automate all sorts of crazy things. Read more

The Bests

The Best-Looking Video Game Consoles Of All Time

You silly fanboys. All these years arguing over things you thought were important, like specs, and libraries, and exclusives, and controllers, wasted. Not once have you considered the most crucial thing about a video game console: how good it looks. Read more

The Founder Institute

The Founder Institute

FI.co: How to Build an MVP as a Non-Technical Founder

The Founder Institute hosts webinars every month so that we can help entrepreneurs on any stage succeed. These webinars discuss a wide range of topics, bestowing global entrepreneurs with invaluabl... Read more

TechCrunch

TechCrunch

Google’s New “About Me” Page Lets You Control What Personal Info Others Can See

Worried that Google has too much of your personal data, thanks to the way it has pried into your life over the years as you steadily adopted more of its.. Read more