Railsアプリケーションを介してメールを送信するときに、会議の招待状にカレンダーを表示するために、Railsでicalendar gemを使用しています。
これを行うための私のコードは次のとおりです。
mails = mail(:from => "organizer@email.com",:to => "organizer@email.com,recipient@email.com",:subject => "subject") do |format|
format.html { render "my_content_partial" }
format.ics {
ical = Icalendar::Calendar.new
ical.custom_property("X-MS-OLK-FORCEINSPECTOROPEN", "TRUE")
e = Icalendar::Event.new
e.start = DateTime.parse(start_time)
e.start.icalendar_tzid="UTC"
e.end = DateTime.parse(end_time)
e.end.icalendar_tzid="UTC"
e.klass "PRIVATE"
e.organizer "organizer@email.com"
e.attendees ["mailto: my@email.com"]
e.summary "#{subject}" #builds the title of the meeting in calendar
e.custom_property("LOCATION", "my location")
ical.add_event(e)
ical.custom_property("METHOD", "REQUEST")
render :text => ical.to_ical
}
mails.deliver
私が直面している問題は、recipient@email.com に送信された電子メールにカレンダーが含まれているが、organizer@email.com の電子メールには表示されないことです。前もって感謝します。