URL-адреса подписки на календарь для внешних приложений календаря

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.

24 лайка

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 лайка

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 лайка

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.

1 лайк

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 лайка

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.

Я использую это с Google Календарём, и это действительно здорово!

Однако изменения событий, похоже, не синхронизируются здесь — будь то редактирование или удаление.

Есть какие-то идеи, почему они не синхронизируются с Google?

Google Calendar в среднем обновляется дважды в день, поэтому изменения могут отображаться в течение нескольких часов.

1 лайк

Ах да, они теперь синхронизированы.

Это очень хорошая новость. Не ожидайте, что последние изменения будут автоматически применены или сообщены!

Аналогично ли это для других сервисов?

1 лайк

Если ты говоришь о календарных сервисах других провайдеров, то принцип тот же — 1–2 раза в день. В своё время я не нашёл решения, чтобы увеличить количество синхронизаций. Позже я подумал, что это вполне нормально, учитывая, сколько календарей нужно синхронизировать по всему миру :rofl: Думаю, они ограничивают это, чтобы не перегружать свои серверы!

Возможно, я ошибаюсь.

2 лайка

Отзыв после реального тестирования:

Контекст: наш экземпляр Discourse используется несколькими группами пользователей/сообществами, у которых есть свои отдельные группы разрешений. Для каждой из этих групп есть главная категория. Эта категория публично видна, а её контент передаётся в Fediverse (Discourse ActivityPub). Также отображается публичный календарь. Пример (https://forum.netzwissen.de/c/meshcore-str/84):

Pasted image 20260401075142.png

Календарь отображает события из постов в главной категории, а также из подкатегорий. Посты со событиями в подкатегориях (которые видны только «авторизованным» пользователям с соответствующей группой разрешений сообщества) не показываются в основном календаре для анонимных пользователей (не авторизованных). Отлично — это ожидаемое поведение!

Я вижу два требования, которые сделают ссылку на ICS-календарь «полностью функциональной». Мы используем новую ссылку на ICS-календарь для публикации событий, созданных в Discourse, на публичных сайтах сообществ (CMS: WordPress).

  1. События, отображаемые в ICS-файле, должны быть «отфильтрованы» по сообществу/группе разрешений. Предлагаемый синтаксис:
[ics_calendar url="https://discourse.example.com/discourse-post-event/events.ics?user_api_key=[xxxx];group=[discourse_group_id]"]

  1. ICS-файл должен отображать только события со статусом «public». События со статусом «private» или «standalone» в целом не должны публиковаться в ICS-файле. Примечание: я ещё не проверял, реализовано ли это уже…

Отличное дополнение! :clap:

К сожалению, даже несмотря на то, что плагин «Календарь» включен (и мы регулярно его используем), при генерации URL-адресов для моего пользователя создаётся только подписка «Закладки». Есть какие-то идеи, почему это может происходить?

Я также согласен с @Thomas_Rother: URL-адреса подписок должны отображаться до момента их отмены или повторной генерации. Устройства и приложения со временем меняются, и необходимость повторно подписываться на всех устройствах только потому, что вы хотите добавить ещё одно, утомительна и кажется излишней. Возможно, это можно сделать опцией конфигурации плагина, в зависимости от чувствительности данных событий.

1 лайк

Чтобы это отображалось, необходимо включить настройку «Включено событие поста Discourse».

Мы уже несколько лет используем пост-события:

Может ли это быть проблемой для установок, которые ранее использовали отдельный плагин? Я также пробовал деактивировать и повторно активировать плагин, но это не решило проблему.

Редактирование: Только что подтвердил — события больше не отображаются в постах. Таким образом, это проблема миграции плагина, а не функции подписки. Разберёмся, что произошло.