Button/link to watch a blog
Asked by Matthew Choy:

Looking for a solution and explanation to adding a button/link on a page that when clicked will add that user as a watcher to the space's blog.


Answers:
author: Kevin Toth
body: I have found a way to do this with our site without the custom code. We use ThemePress and had the same issue where we have a page serving up blog content. I was able to create a link button and direct it to this endpoint:

```
users/addspacenotification.action?spaceKey=[XX]&amp;contentType=blogpost
```

It will redirect users to their "Watches" page in their profile but the resulting action works and they are now watching the space blogs

comments: author: Jan
body: I am looking for exactly this: Create a link or button with a link on any page to watch the blog of any (in the URL specified) space. When I try above mentioned link, Confluence tells me that the request is missing a required security token.

When I just copy the URL from the regular space watch button, this seems to contain some kind of session or something. Can anybody help out? The user macro mentioned at the top does not work for me either.


author: Vera Henrichs
body: How about this feature? <https://jira.atlassian.com/browse/CONF-40582> Pllease vote!


author: Nick Muldoon
body: Hi Matthew, Stephen,

On the off chance that you don't want to maintain this code snippet and instead just want to subscribe a group of people to watch for new blogs in a space I invite you to explore *[Better Blogs for Confluence](https://marketplace.atlassian.com/plugins/com.arijea.plugins.betterblogs)*.

Better Blogs is a paid add-on that allows Space Administrators to subscribe users and groups to email notifications of new blogs in a space.

At Twitter we needed this feature to ensure every member of our product, design and engineering organisation (\>1,500 people) were notified of new blog posts in the Engineering space. It didn't make sense to ask every new employee to subscribe to the blog in that space, and I didn't see this script at the time, hence Better Blogs was born.

With Better Blogs you can keep everyone informed, and do so with ease. If you're interested there is a 40% discount (use the promotion code [HHYUWD](https://promo.atlassian.com/HHYUWD)) before the end of October 2015.

Any feedback? Contact me via [nick@arijea.com^![](https://jira.atlassian.com/images/icons/mail_small.gif)^](mailto:nick@arijea.com) or +1 415 568 7064.

Thanks gents, hope you don't mind me dropping this note here.

Cheers,  
Nicholas Muldoon  
[Arijea](http://arijea.com/)

comments: author: Jorge
body: What if somebody wants to opt out? Or a new person wants to opt in? We want to enable the individuals to own that instead of manage this in a centralized way, is this possible with your Plugin?


author: Nick Muldoon
body: Hi @Jorge,Today there is:- the ability to subscribe if you are not in the group,- no option for an individual to opt-out from the subscriptionOne of our customers requested the ability to allow a subscribed group user to opt-out of notifications in December. And it sounds like it would be necessary for you too.We'll proceed with that work next week and release before end of January.Thanks Jorge, have a great week,Nick


author: clem
body: Hi @Nick Muldoon Is this work done already?

Thanks,

Cynthia


author: Nick Muldoon
body: Hi Cynthia,

Yes, we added the ability for a Space Administrator to specify whether a user subscribed as part of a group can opt-out of email notifications (on a per space basis) in 1.0.8 released last week. And the ability to opt-out for a user was added in 1.0.5 in February.

Let me know if we can help - [nick@arijea.com.](mailto:nick@arijea.com.)

Thanks Cynthia,  
Nick


author: Stephen Deutsch
body: Hi Matthew,

Here is a user macro I wrote to allow you to do that. It is a bit hacky, but it worked when I tested it:

```
## @noparams&lt;a id="blog-watch-button" class="aui-button" href="javascript:void(0)" onclick="jQuery('#cw-watch-blogs').click();jQuery(this).hide();" style="display:none;"&gt;Watch This Blog&lt;/a&gt;&lt;style&gt;  #inline-dialog-confluence-watch {    opacity: 0;  }&lt;/style&gt;&lt;script&gt;jQuery(window).load(function () {  jQuery('#watch-content-button').click();  setTimeout( breakFocus , 10 );});var breakFocus = function() {  jQuery('#main-content').click();  if(!jQuery('#cw-watch-blogs').prop('checked')) {    jQuery("#blog-watch-button").show();  }  setTimeout( showAgain, 500 );}var showAgain = function() {  document.getElementById('inline-dialog-confluence-watch').style.opacity = '1';}&lt;/script&gt;
```

Actually, all this user macro does is take advantage of the fact that you can click on the watch button and click "Watch for new blog posts in this space". This just turns it into a button. If the user is already watching the blog space, then it will not show.

comments: author: Matthew Choy
body: Hi Stephen,

Thanks for this. Do you know if it is possible to tweak this to work on a different page but the same space as the blog?

Thanks,

Matthew


Tags: addon-com.arijea.plugins.betterblogs

blog

watcher