Content
You are here:
[SOLVED] OpenProject 3: Email on work package update – should it work?
Added by Daniel Jagszent over 10 years ago
I’m using OpenProject 3 (3.0.0pre44) and successfully configured email notifications (the test email works, email on work package creation works, I activated all actions in Settings -> Email notifications )
But I do not get any email notifications when a work package gets updated.
Can it be that the logic for that is missing in OpenProject 3? I had a peek in the source and found https://github.com/opf/openproject/blob/dev/app/models/journal_observer.rb – doesn’t look like the necessary after_update hook is present. But maybe I’m missing something?
Replies (7)
Hi Daniel,
have you set up delayed job
Kind regards,
Hagen
we send the email notifications on work package update delayed since the amount of recipients is not known and maybe very large. For the delay we use delayed_job from collectiveidea (https://github.com/collectiveidea/delayed_job/). On this page you can find how to use the delay_job.
A short how to:
First you should delete all entries in the ‘delayed_jobs’ table except you want to deliver ALL OLD emails from work package update.
Than you can start the delayed job:
Switch to OpenProject main folder (rails root) and run this command (adapt the RAILS_ENV to your current rails env):
RAILS_ENV=production script/delayed_job start
To stop the delayed job you can run the following command:
RAILS_ENV=production script/delayed_job stop
Be aware that you have to stop the delayed_job if you change (eg. update) the OpenProject code and start the delayed_job afterwards since the delayed_job runs with the code which it founds on startup.
Thanks! Works like a charm!
i’m using the same version OpenProject 3 (3.0.0pre44), have setup Delayed_jobs and i’m using sendmail for delivery. I successfully use sendmail with 4 chiliprojects on the same server.
production:
email_delivery_method: :sendmail
default:
email_delivery_method: :sendmail
———————————————————————————————————————————————————————————
no mail is sent when i look in the /var/mail/log but i see that mails are sent in the production log
Completed 200 OK in 693.5ms (Views: 440.3ms | ActiveRecord: 104.6ms)
Rendered user_mailer/_issue_details.html.erb (17.3ms)
Rendered user_mailer/issue_updated.html.erb within layouts/user_mailer (22.7ms)
Rendered user_mailer/_issue_details.text.erb (5.0ms)
Rendered user_mailer/issue_updated.text.erb within layouts/user_mailer (6.1ms)
Sent mail to paperjam@gmail.com (25.1ms)
2014-02-19T13:37:36+0100: [Worker(delayed_job host:[edited] pid:20255)] Class#issue_updated completed after 0.1458
Rendered user_mailer/_issue_details.html.erb (18.5ms)
Rendered user_mailer/issue_updated.html.erb within layouts/user_mailer (24.2ms)
Rendered user_mailer/_issue_details.text.erb (5.5ms)
Rendered user_mailer/issue_updated.text.erb within layouts/user_mailer (6.6ms)
Sent mail to denis.lamotte@gmail.com (27.0ms)
2014-02-19T13:37:36+0100: [Worker(delayed_job host:[edited] pid:20255)] Class#issue_updated completed after 0.1495
2014-02-19T13:37:36+0100: [Worker(delayed_job host:[edited] pid:20255)] 2 jobs processed at 4.9726 j/s, 0 failed …
———————————————————————————————————————————————————————————
how can i debug this ?
Hi Denis,
I’m not sure if it is related to copy&paste but since the email configuration is done in a yml file the indentation is important and your config should look like this:
Btw. OpenProject mail configuration should work exactly like chiliproject one
Best
Ratzi
it is the case, yes it’s a valid yaml file
well i keep looking :(
Well, from what i see many work_packages created/updated does not created the delayed_jobs entries.
With
i was able to receive 2 emails on 10 tasks created with the same options except the content, that’s weird !!
Updating TimeEntries does not seems to trigger any mail, nor the creation of a sub tasks.