Button/link to watch a blog

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.

4 answers

0 vote
Stephen Deutsch Community Champion Feb 05, 2015

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
<a id="blog-watch-button" class="aui-button" href="javascript:void(0)" onclick="jQuery('#cw-watch-blogs').click();jQuery(this).hide();" style="display:none;">Watch This Blog</a>
<style>
  #inline-dialog-confluence-watch {
    opacity: 0;
  }
</style>
<script>
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';
}
</script>

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.

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

0 vote
Nicholas Muldoon Community Champion Oct 02, 2015

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.

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) before the end of October 2015.

Any feedback? Contact me via nick@arijea.com or +1 415 568 7064.

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

 

Cheers,
Nicholas Muldoon
Arijea

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?

Nicholas Muldoon Community Champion Jan 10, 2016

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 subscription One 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

Hi @Nick Muldoon Is this work done already?

Thanks,

Cynthia

Nicholas Muldoon Community Champion Mar 21, 2016

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.

Thanks Cynthia,
Nick

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]&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

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Posted Jul 10, 2018 in Confluence

We want to see the templates you've created in Confluence!

Hi Community, Jessica here from the Confluence Product Marketing team!  July’s community challenge is all about sharing pictures  — and as an extension of our first post on what ...

902 views 23 12
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you