Email Reminders
Added by Lee Taylor about 16 years ago
Hi all,
I noted this page: http://redmine.rubyforge.org/svn/trunk/lib/tasks/reminder.rake (in order to apply sending email notifications to the necessary users assigned to the tasks).
Shall I simply be able to run this command below to initiate email reminders?
Command: rake redmine:send_reminders days=7 RAILS_ENV="production"
Thank you.
Replies (10)
RE: Email Reminders
-
Added by Sean Murphy about 16 years ago
Lee,
I did not get reminders daily for the command above. The reminders worked only when I ran the command, which of course isn't the point.
What I did was create a 'company_reminders' file in our redmine/lib/tasks dir and run that from our cron.
Since this wasn't as straight forward to me as possibly should have been I'll try to help you (and others) out.
$vi /srv/www/htdocs/redmine/lib/tasks/company_reminders (or wherever you want the file located, I put ours in the same dir as the reminder.rake file)
- begin company_reminders file
- since cron doesn't have the paths set, use the full path to your rake dir (which for me was /usr/local/bin/)
- I specify the RAILS_ENV outside of the send_reminders rake
/usr/local/bin/rake RAILS_ENV=production redmine:send_reminders days=7 project=2
/usr/local/bin/rake RAILS_ENV=production redmine:send_reminders days=0 project=2 - put each reminder you want on a seperate line
- end company reminders_file
$sudo crontab -e
- use sudo crontab -e instead of crontab -e to avoid any need for user/pswds
- begin cron file addition, this all goes on one line
0 6 * * * cd /srv/www/htdocs/redmine/lib && /srv/www/htdocs/redmine/lib/tasks/company_reminders > /srv/www/htdocs/redmine/lib/tasks/company_reminders.log 2>&1
- This is the breakdown of the command in parts:
- {0 6 * * *} => run every day at 6:00 AM
- {cd /srv/www/htdocs/redmine/lib} => location of your redmine.rb rake project file !!SUPER IMPORTANT!!
- {&& /srv/www/htdocs/redmine/lib/tasks/company_reminders} => And now execute the lines in the company_reminders file
- {> /srv/www/htdocs/redmine/lib/tasks/company_reminders.log 2>&1} => overwrite/create a company_reminders.log for errors
- Note: I overwrite the company_reminders.log file each time, use >> to append it.
- Note2: This log option is not necessary
That's it. It takes cron a couple minutes (literally 1-2 minutes) to process the added entry.
If you want to test it immediately (and who doesn't) change the 0 6 * * * to * * * * * to run every minute until you see an error file or you get emails.
Good luck!
RE: Email Reminders
-
Added by Lee Taylor about 16 years ago
Sean,
That's great! Thanks for taking the time to get all this down for the benefit of the community.
I'll try it out soon and reply with the status of our progress.
Very Much appreciated.
RE: Email Reminders
-
Added by Michael Aye over 15 years ago
What's the status on this?
Is this still the only way to have email reminders?
Does this way work?
RE: Email Reminders
-
Added by Lee Taylor over 15 years ago
Hey Michael,
If you're updated to the latest version, check this post out
As stated, you can run this command to see available options: rake -D redmine:send_reminders
An example would look like this:
rake redmine:send_reminders days=7 RAILS_ENV="production"
Hope that helps!
Thanks,
Lee
RE: Email Reminders
-
Added by Lee Taylor over 15 years ago
Also just to note, be sure to add this command to run via a cron job. just wanted to make sure this was noted unless not assumed.
Thanks.
RE: Email Reminders
-
Added by Michael Aye over 15 years ago
In Sean's instruction is missing that the new file "company_reminders" needs to have execution permission set with "chmod u+x company_reminders", otherwise crontab won't execute it, even so the same commandline works inside a shell.
Best regards,
Michael
RE: Email Reminders
-
Added by Axel dV about 15 years ago
Not bad yep. But it sends reminders on "Resolved" tasks. Why is that?
Cheers
Axel
RE: Email Reminders
-
Added by Axel dV about 15 years ago
Axel dV wrote:
Not bad yep. But it sends reminders on "Resolved" tasks. Why is that?
CheersAxel
Don't worry about my question. Found a workaround
Other question: my reminder sends every morning at 6AM the tasks for the same day. Does it also send reminders for over-due tasks?
Cheers
RE: Email Reminders
-
Added by Gildo Caceres almost 15 years ago
How do you make in order to avoid notifications of "Resolved" and "Closed" tasks?
RE: Email Reminders
-
Added by demt hu over 13 years ago
How do you make in order to avoid notifications of "Resolved" and "Closed" tasks?