0
我的应用程序需要发送电子邮件给.ics附件的用户。可能通过电子邮件发送.ics文件而不创建它?
目前我有渲染的.ics文件,当用户点击网页上的链接的动作:
def invite
cal = Icalendar::Calendar.new
cal.event do |e|
e.dtstart = Icalendar::Values::Date.new('20050428')
e.dtend = Icalendar::Values::Date.new('20050429')
e.summary = "Meeting with the man."
e.description = "Have a long lunch meeting and decide nothing..."
e.ip_class = "PRIVATE"
end
cal.publish
render text: cal.to_ical
end
链接:
<%= link_to 'Download .ics file with right click', invite_path(format: :ics) %>
是否有可能的话,在同样的方式,为电子邮件提供一个ics-attachment而不先创建/保存该文件,然后引用该路径?
如果是这样,我该如何去做这件事?