Project

General

Profile

Actions

task #42

closed

No notification sent when reccurence is created

Added by milossramek over 1 year ago. Updated 12 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

Actions #1

Updated by cryptogopher over 1 year 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.

Actions #2

Updated by admin over 1 year ago

  • Tracker changed from 3 to task
Actions #3

Updated by cryptogopher over 1 year ago

  • Status changed from in progress to feedback
Actions #4

Updated by pistol_bjj about 1 year 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.

Actions #5

Updated by cryptogopher about 1 year 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.

Actions #6

Updated by cryptogopher about 1 year ago

  • Status changed from feedback to closed
Actions #7

Updated by cryptogopher about 1 year 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).

Actions #8

Updated by pistol_bjj 12 months ago

cryptogopher it seems it works fine. Thanks

Actions

Also available in: Atom PDF