Project

General

Profile

task #42

No notification sent when reccurence is created

Added by milossramek 11 months ago. Updated 4 months ago.

Status:
closed
Priority:
support
Assignee:
Target version:
Redmine version:
5.0.x

Description

Hi,
Now that the assignee is correctly copied (#40), I've expected, that a notification mail is sent either when a recurrence is created or on its starting date.
I set up an issue with daily recurrence about a week ago, but I've not got any notifications.

I expected to get some notifications. Is that OK?

Thanks for your help in advance.
Milos


Token votes

Associated revisions

Revision 25ba0cd8 (diff)
Added by cryptogopher 5 months ago

Use :inline, not :async queue for email delivery

Closes #42

History

#1 Updated by cryptogopher 11 months ago

  • Status changed from new to in progress

Notifications are not sent by plugin itself, only by Redmine, according to settings.

If you don't get notifications you can check that:
  • recurrence issues have the author or assignee set to account you expect to be notified - these can be manipulated using plugin setting: Set author of new recurrence to and Keep assignee from previous recurrence,
  • for in-place recurrences (they don't create new issues) you may want to use setting Add journal entry on recurrence renewal - which informs Redmine that issue has changed and notification sending should be considered,
  • you have e-mail notifications settings on My account page set according to your expectations.

As a side note: I experience kind of bug in Redmine 4.2, that causes notifications to be sent intermittently (i.e. not for every recurrence). I have not yet debugged this issue and have no idea if it persists in Redmine 5.0 or whether it's caused by Redmine or my particular setup. But if you don't get even a single notification, the problem is rather in settings.

#2 Updated by admin 11 months ago

  • Tracker changed from 3 to task

#3 Updated by cryptogopher 11 months ago

  • Status changed from in progress to feedback

#4 Updated by pistol_bjj 5 months ago

Had similar issue.
I found out that emails are sent by redmine asynchronously after some delay.
When crontab task had been executed, process was finished before email sending. During task "rake redmine:issue_recurring:renew_all" emails to be sent was queued, but queue wasn't flushed.

When I added at the end of method self.renew_all in plugins/issue_recurring/app/models/issue_recurrence.rb line

sleep(30)

the queue was flushed, email processed, sent and delivered.

#5 Updated by cryptogopher 5 months ago

pistol_bjj wrote:

Had similar issue.
I found out that emails are sent by redmine asynchronously after some delay.
When crontab task had been executed, process was finished before email sending. During task "rake redmine:issue_recurring:renew_all" emails to be sent was queued, but queue wasn't flushed.

That's great observation. I think it explains both mine and milossramek problems.

In my case, the notification mail was mostly not delivered when there was only 1 email to be sent during the cron task. Otherwise - when there were 2 or more emails - the process of sending commenced and was carried out properly. As if the 2nd mail was enough to trigger flushing the DeliveryJob's queue.

I just found out that there is a special method for delivering emails inside Rake tasks in Redmine (app/models/mailer.rb):

  ...
  # Execute the given block with inline sending of emails if the default Async
  # queue is used for the mailer. See the Rails guide:
  # Using the asynchronous queue from a Rake task will generally not work because
  # Rake will likely end, causing the in-process thread pool to be deleted, before
  # any/all of the .deliver_later emails are processed
  def self.with_synched_deliveries(&block)
  ...

I will wrap email-processing code with this method and check if it solves the problem.

#6 Updated by cryptogopher 5 months ago

  • Status changed from feedback to closed

#7 Updated by cryptogopher 5 months ago

pistol_bjj

You can pull latest commit and let us know whether that fixes the problem for you (please remove sleep statement for testing).

#8 Updated by pistol_bjj 4 months ago

cryptogopher it seems it works fine. Thanks

Also available in: Atom PDF