-
-
Notifications
You must be signed in to change notification settings - Fork 15
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
Generate ics files directly #44
Comments
I don't currently need this feature, but if someone does let me know as I'd be willing to implement it. |
|
Hi! I also need this feature.
But when I send this HTML partial in an email as a event reminder, it won't work because the download link is escaped/removed by the email provide such as Google. As an alternative, I'd like to send the ICS file directly for the link |
@hegwin sorry for the mega delay. Life and all that 🙃 I took a quick look at this and you can generate an ICS file like so: cal = AddToCalendar::URLs.new(start_datetime: Time.new(2020,12,12,13,30,00,0), title: "Christmas party!", timezone: 'Europe/London')
ical_without_data_prefix = cal.ical_url.delete_prefix("data:text/calendar;charset=utf8,")
ical_file_content = URI.decode_www_form_component(ical_without_data_prefix)
File.open("event_filename.ics", "w") { |file| file.write(ical_file_content) } There might be a weird extra |
Currently, we generate a data-uri for iCal which can be used to download an .ics file.
But if we want to attach an .ics file to emails, we need to generate it directly (otherwise the url encoding for the data-uri borks the calendar display when imported into a calendar.
The text was updated successfully, but these errors were encountered: