On Thu, Oct 23, 2008 at 12:16 PM, <benjamin.lan-sun-luk(a)supinfo.com> wrote:
From: Benjamin LAN-SUN-LUK <benji(a)Wloups.lan>
Required:
- Install gems, use: "rake gems:install"
- Configure mail, create a file at "config/mailer.yml". Use example at
"config/mailer.yml.example"
I have done some change in mail management. Now, mail are managed at
"config/initializers/mailer.rb".
For test mail, don't forget to complete the config file with your server adress,
username, and password. If send mail not work, then feedback to me.
If you want to use sendmail for the server. You have just to set
"ActionMailer::Base.delivery_method = :sendmail" in
"config/initializers/mailer.rb".
I will write a wiki if mail were functional.
NAK - In testing, I found two issues in this patch.
1. Your mistakenly added a mailer.yml file that contains your real
login information for Gmail. You'll want to remove that.
2. The following bug is present in schedules.rb:
diff --git a/config/initializers/schedules.rb
b/config/initializers/schedules.rb
new file mode 100644
index 0000000..23113be
--- /dev/null
+++ b/config/initializers/schedules.rb
@@ -0,0 +1,54 @@
+require 'fastthread'
+require 'openwfe/util/scheduler'
+include OpenWFE
+
+# Initialize a threads array
+threads = []
+
+threads << Thread.new do
+ scheduler = Scheduler.new
+ scheduler.start
+
+ # Do this everyday at 05:00 am
+ scheduler.schedule('0 5 * * *') do # TODO Time must be configurable
+
+ user_no_activity_on_backlog_items = {}
+ user_no_tasks_on_backlog_items = {}
+
+ BacklogItem.find_all_by_state(BacklogItem::STATE_ASSIGNED).each do |backlog_item|
+ if backlog_item.tasks.empty?
+
+ backlog_item_owner = backlog_item.owner
+ user_no_tasks_on_backlog_items[backlog_item_owner] ||= []
+ user_no_tasks_on_backlog_items[backlog_item_owner] << backlog_item_owner
I think this should be:
user_no_tasks_on_backlog_items[backlog_item_owner] << backlog_item
and not adding the user object itself to the array. When I changed it
to be the item itself, it didn't fail there, but it still didn't send
an email.
I pointed the mailer.yml file back to my laptop's SMTP server, and saw
where it tried to connect but never actually sent the email.
--
Darryl L. Pierce <mcpierce(a)gmail.com>
Visit the Infobahn Offramp: <
http://mcpierce.multiply.com>
"Bury me next to my wife. Nothing too fancy..." - Ulysses S. Grant