discourse/app/views/users/bookmarks.ics.erb
Rafael dos Santos Silva b38c2d7e9b
FEATURE: Add friendly names to calendar subscription feeds (#39154)
## Summary
- add friendly `X-WR-CALNAME` values to bookmark reminder ICS feeds
- add friendly `X-WR-CALNAME` values to discourse-calendar event ICS
feeds
- cover the new calendar names in the relevant request specs

## Context


https://meta.discourse.org/t/the-webcal-url-is-incorrectly-passed-to-the-calendar-name-field-in-google-calendar/400167/5
2026-04-08 13:34:04 -03:00

16 lines
721 B
Text

BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//Discourse//<%= Discourse.current_hostname %>//<%= Discourse.full_version %>//EN
X-WR-CALNAME:<%= IcalEncoder.encode(@calendar_name) %>
<% @bookmark_reminders.each do |bookmark| %>
BEGIN:VEVENT
UID:bookmark_reminder_#<%= bookmark.id %>@<%= Discourse.current_hostname %>
DTSTAMP:<%= bookmark.updated_at.strftime(I18n.t("datetime_formats.formats.calendar_ics")) %>
DTSTART:<%= bookmark.reminder_at_ics_start %>
DTEND:<%= bookmark.reminder_at_ics_end %>
SUMMARY:<%= IcalEncoder.encode(bookmark.name.presence || bookmark.title) %>
DESCRIPTION:<%= IcalEncoder.encode(bookmark.bookmarkable_url) %>
URL:<%= IcalEncoder.encode(bookmark.bookmarkable_url) %>
END:VEVENT
<% end %>
END:VCALENDAR