我试图找出如何使用的iCalendar红宝石的宝石,在发现:红宝石的iCalendar宝石:如何得到电子邮件提醒工作
http://icalendar.rubyforge.org/
根据他们的教程,你做的东西像:
cal.event.do
# ...other event properties
alarm do
action "EMAIL"
description "This is an event reminder" # email body (required)
summary "Alarm notification" # email subject (required)
attendees %w(mailto:[email protected] mailto:[email protected]) # one or more email recipients (required)
add_attendee "mailto:[email protected]"
remove_attendee "mailto:[email protected]"
trigger "-PT15M" # 15 minutes before
add_attach "ftp://host.com/novo-procs/felizano.exe", {"FMTTYPE" => "application/binary"} # email attachments (optional)
end
alarm do
action "DISPLAY" # This line isn't necessary, it's the default
summary "Alarm notification"
trigger "-P1DT0H0M0S" # 1 day before
end
alarm do
action "AUDIO"
trigger "-PT15M"
add_attach "Basso", {"VALUE" => ["URI"]} # only one attach allowed (optional)
end
所以,我在做我的代码类似的东西。
def schedule_event
puts "Scheduling an event for " + self.title + " at " + self.start_time
start = self.start_time
endt = self.start_time
title = self.title
desc = self.description
chan = self.channel.name
# Create a calendar with an event (standard method)
cal = Calendar.new
cal.event do
dtstart Program.convertToDate(start)
dtend Program.convertToDate(endt)
summary "Want to watch" + title + "on: " + chan + " at: " + start
description desc
klass "PRIVATE"
alarm do
action "EMAIL"
description desC# email body (required)
summary "Want to watch" + title + "on: " + chan + " at: " + start # email subject (required)
attendees %w(mailto:[email protected]) # one or more email recipients (required)
trigger "-PT25M" # 25 minutes before
end
end
但是,我从来没有看到任何电子邮件发送到我的账户......我甚至尝试硬编码的开始时间是Time.now,0分钟,然后送他们,但没有运气。 ..我做了一件明显错误的事情吗?
男人,完全被误解,然后.... – Jenny 2010-04-29 23:04:02