Calendar subscription URLs for external calendar apps

We’ve added a new Calendar tab to user preferences that lets you subscribe to Discourse feeds in external calendar apps like Google Calendar, Apple Calendar, and Microsoft Outlook.

:down_arrow:

How it works

Navigate to your Preferences → Calendar tab and click Generate Subscription URLs. You’ll get one-click subscribe buttons for:

  • Google Calendar — opens Google Calendar with the feed pre-filled
  • Microsoft Outlook — opens Outlook’s web subscription dialog
  • Apple Calendar — triggers the native Calendar app via webcal://
  • Copy URL — for any other calendar app that supports ICS feeds

Available feeds

Always available:

  • Bookmarked Reminders — your bookmarks that have reminder dates

With the discourse-calendar plugin enabled:

  • All Events — all forum events
  • My Events — events you’re going to or interested in

For plugin developers

Plugins can register additional ICS feeds using the new register_calendar_subscription_feed API. Feeds registered this way automatically appear in the Calendar preferences tab when the plugin is enabled.

Security

Subscription URLs use scoped user API keys restricted to read-only ICS format access. Keys are rate-limited, and URLs are displayed only once at generation time — users can regenerate at any time, which revokes the old URLs.

19 Likes

Thank you @Falco, but how do you remove the corporate options? I find it offensive for my community to have to see advertising for proprietary services.

You can hide it with CSS.

2 Likes

Thanks a lot for this implementation - this will increase the usability of the calendar/events plugin for many communities!

I have the same objection as @hellekin: within Discourse, we are in an Open Source environment. In our community, nobody use either Google Calendar or Microsoft. If users need a link for these proprietary services, they should decide by themselves, not the application. Thus I would prefer to select the kind of external Calendar service upon the creation step of the subscription URLs (e.g. with some check boxes), not later.

“filter”enhancement

We have multiple communities on our discourse instance. They are separated by group permissions and some users are member of more than one community. It would be convenient to filter the “Discourse Calendar - All Events” URL so that it only displays a particular communities calendar entries. Sample URL

https://discourse.example.com/discourse-post-event/events.ics?user_api_key=c2aa22d800dd473b62d199d796742382&group=[groupname]

With this enhancement it would be possible to share the Discourse events of a particular (!) community on their own website, eg. with the WordPress plugin “ICS calendar”

2 Likes

Another small proposed enhancement: if you want to subscribe the Discourse events on two different clients (e.g. Thunderbird on two devices), you need to copy the url two times. But currently the URL is only displayed once. If you add a second client you have to regenerate the URLs and the you loose the first ones.

Doesn’t a feed generated by a user in one of those groups already works that way? Did you test it?

You need to copy only once, then paste in the two clients you need.

And if you forget a client, you can regenerate with one click.

2 Likes

This is pretty cool. A feed idea might also be the Saved Searches plugin

I understand, but my point is the required regeneration after the URLs are shown first.

If I use the calendar link on two different devices, they are probably not available for configuration at the same time. I would access my Discourse profile from the first device and later again from the second device. It would be better to show the old URL again and only invalidate it by explicit request

If I am a member of two different communities (and their permission groups), the “https://discourse.example.com/discourse-post-event/events.ics“ shows the events of both communities. Thats correct so far. But both communities may have their own website. If I want to share the events from Discourse on their websites, I would only want to see the events of “community A” but not “community B”. And vice versa.