How to view ics file from calendar invitation mail?

In my invitation file. All I see is a calendar object #<Icalendar::Calendar:0xb299a54> I tried to implement this link , but I get the same .ics file with the object. I'm new to ruby. Can someone please tell me the best tutorial on sending calendar invitations for Google Calendar, Outlook, ical. Here's the code for now.

 class MeetingNotification < ActionMailer::Base # include Icalendar def meeting_request_with_calendar mail(:to => " ashi_12@gmail.com ", :subject => "iCalendar", :from => " tester@gmail.com ") do |format| format.ics { ical = Icalendar::Calendar.new e = Icalendar::Event.new e.start = DateTime.now.utc e.start.icalendar_tzid="UTC" # set timezone as "UTC" e.end = (DateTime.now + 1.day).utc e.end.icalendar_tzid="UTC" e.organizer " tester@gmail.com " e.uid "MeetingRequest" e.summary "Scrum Meeting" e.description <<-EOF Venue: Office Date: 16 August 2013 Time: 10 am EOF ical.add_event(e) ical.publish ical.to_ical render :text => ical, :layout => false } end end 
+4
source share
1 answer

Maybe I'm too late to answer. I had the same problem. I fixed it by calling to_ical when using the render method. try it

 render :text => ical.to_ical 
+3
source

Source: https://habr.com/ru/post/1495892/


All Articles