Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add alerts to exported calendars #5318

Closed
PerilousApricot opened this issue Apr 12, 2022 · 5 comments · Fixed by #5320
Closed

Add alerts to exported calendars #5318

PerilousApricot opened this issue Apr 12, 2022 · 5 comments · Fixed by #5320
Milestone

Comments

@PerilousApricot
Copy link
Contributor

Is your feature request related to a problem? Please describe.
I follow a couple of different sub-groups' meeting schedule by subscribing to their iCal links using my calendaring software. However, the exported links do not have reminders attached to the events, and I often forget to attend meetings.

Describe the solution you'd like
It would be nice to have either a per-user or per-link ability to attach default notifications to events. For example, I could say "for any calendar I export, please attach an to the iCal export an alert 15 minutes before and 5 minutes before the event begins". Then my calendar software (Apple calendars in my case" will send me a reminder notification.

Describe alternatives you've considered
From my research, it appears that neither Apple calendars nor the iCal format itself support doing this from the client side, so as far as I understand it, this needs to be implemented on the server side.

Additional context
I am using the Indico instance at CERN, so it's possible they are using an older version without this software included.

@ThiefMaster
Copy link
Member

I think multiple reminders would be overkill, but if someone contributed an option (with nice UI of course) to configure whether to enable reminders when generating the ical link, we'd be very likely to integrate it.

so it's possible they are using an older version

No. In fact we are usually using a newer version than anyone else else ;)

@PerilousApricot
Copy link
Contributor Author

@ThiefMaster Im unfamiliar with the indico code base, but could take at least an initial stab at it. I think it may be easier (code-wise) to apply the setting per-user and not per exported ical. What do you think?

@ThiefMaster
Copy link
Member

Per user is a good idea and it'd be indeed easier!

If you'd like to give it a shot, here are some pointers:

  • The ical files for events/categories are generated though RHExportEventICAL and RHExportCategoryICAL; in the end events_to_ical is used to generate the ical data so that'd be the place to add the alarms - note that user can be None if these files are not generated within the context of a specific user
  • The user preferences form is handled through RHUserPreferences - there's already generic logic for the storage; UserPreferencesForm and user_settings = UserSettingsProxy(.... are the places to add a new setting

The most flexible implementation for the setting would probably be a number field with empty being no reminder, and otherwise the entered value being the minutes before the event when the reminder should be triggered

PerilousApricot added a commit to PerilousApricot/indico that referenced this issue Apr 12, 2022
Many (all?) calendar clients do not support adding reminders ("alerts"
in iCal parlance) to external calendars syncrhonized via URL. Add a
per-user preference to attach reminders to any events exported to iCal.

Tested on local dev install both as a logged-in and anonymous user, both
with and without a reminder preference. This produced an iCal that Apple
Calendars properly recognized the reminders:

BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//CERN//INDICO//EN
BEGIN:VEVENT
SUMMARY:testEvent title
DTSTART;VALUE=DATE-TIME:20220425T150000Z
DTEND;VALUE=DATE-TIME:20220425T170000Z
DTSTAMP;VALUE=DATE-TIME:20220412T151800Z
UID:indico-event-8@localhost
DESCRIPTION:testEvent Description\n\nhttp://localhost:8000/event/8/
URL:http://localhost:8000/event/8/
BEGIN:VALARM
ACTION:AUDIO
DESCRIPTION:testEvent Description\n\nhttp://localhost:8000/event/8/
PRODID:-//CERN//INDICO//EN
SUMMARY:testEvent title
TRIGGER:-PT5M
END:VALARM
END:VEVENT
END:VCALENDAR

Fixed indico#5318
PerilousApricot added a commit to PerilousApricot/indico that referenced this issue Apr 12, 2022
Many (all?) calendar clients do not support adding reminders ("alerts"
in iCal parlance) to external calendars syncrhonized via URL. Add a
per-user preference to attach reminders to any events exported to iCal.

Tested on local dev install both as a logged-in and anonymous user, both
with and without a reminder preference. This produced an iCal that Apple
Calendars properly recognized the reminders:

BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//CERN//INDICO//EN
BEGIN:VEVENT
SUMMARY:testEvent title
DTSTART;VALUE=DATE-TIME:20220425T150000Z
DTEND;VALUE=DATE-TIME:20220425T170000Z
DTSTAMP;VALUE=DATE-TIME:20220412T151800Z
UID:indico-event-8@localhost
DESCRIPTION:testEvent Description\n\nhttp://localhost:8000/event/8/
URL:http://localhost:8000/event/8/
BEGIN:VALARM
ACTION:AUDIO
DESCRIPTION:testEvent Description\n\nhttp://localhost:8000/event/8/
PRODID:-//CERN//INDICO//EN
SUMMARY:testEvent title
TRIGGER:-PT5M
END:VALARM
END:VEVENT
END:VCALENDAR

Fixed indico#5318
@PerilousApricot
Copy link
Contributor Author

Hi @ThiefMaster - Please check #5320 and tell me what you think. I was able to test it locally, but I'm unsure of how to write unit tests for this.

@ThiefMaster
Copy link
Member

Thanks! I don't think tests are needed for this unless we already have unit tests for the ical stuff, which I don't think we do ;)

@ThiefMaster ThiefMaster added this to the v3.2 milestone Apr 12, 2022
ThiefMaster pushed a commit to PerilousApricot/indico that referenced this issue Apr 20, 2022
Many (all?) calendar clients do not support adding reminders ("alerts"
in iCal parlance) to external calendars syncrhonized via URL. Add a
per-user preference to attach reminders to any events exported to iCal.

Tested on local dev install both as a logged-in and anonymous user, both
with and without a reminder preference. This produced an iCal that Apple
Calendars properly recognized the reminders:

BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//CERN//INDICO//EN
BEGIN:VEVENT
SUMMARY:testEvent title
DTSTART;VALUE=DATE-TIME:20220425T150000Z
DTEND;VALUE=DATE-TIME:20220425T170000Z
DTSTAMP;VALUE=DATE-TIME:20220412T151800Z
UID:indico-event-8@localhost
DESCRIPTION:testEvent Description\n\nhttp://localhost:8000/event/8/
URL:http://localhost:8000/event/8/
BEGIN:VALARM
ACTION:AUDIO
DESCRIPTION:testEvent Description\n\nhttp://localhost:8000/event/8/
PRODID:-//CERN//INDICO//EN
SUMMARY:testEvent title
TRIGGER:-PT5M
END:VALARM
END:VEVENT
END:VCALENDAR

Fixed indico#5318
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants