Ruby on Rails: Create email for an event using iCalendar. Google does not recognize this

Perhaps this is not what makes Google bigger! I have the following code.

mail(from: @process_action.finance_case.case_owner.user.email, to: @process_action.finance_case.case_owner.user.email, subject: "Appointment") 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 "any_email@example.com"
   e.uid "MeetingRequest#{unique_value}"
   e.summary "Scrum Meeting"
   ical.add_event(e)
   ical.publish
   ical.to_ical
   render :text => ical.to_ical
  }
end

We tried setting the content type to text / calendar and several other rand changes to see if that helped. Someone suggests that the “method” should be set for the REQUEST so that Google recognizes, but is not sure how and where.

Any help / pointers would be greatly appreciated. Or even if it will work in Outlook, because this is what the client uses.

UPDATE. Not clear up above, but email is being delivered. Its a google that does not recognize it as an invitation to an event.

+4
2

, ics , , . Gmail " ":

# Generate the calendar invite
ical = Icalendar::Calendar.new
e = Icalendar::Event.new
...
ical.add_event(e)
ical.publish

# Add the .ics as an attachment
attachments['event.ics'] = { mime_type: 'application/ics', content: ical.to_ical }

# Generate the mail
mail(from: ..., to: ...)
+2

.deliver! .

mail(to: 'thisguy', from: 'thatguy', subject: 'Hey').deliver!
-1

All Articles