Email notifications, strange issue

Hello,

I have a strange issue with the e-mail notifications.

In my useraccount i have set the following:

Everyday at 00:00 I receive an email with expiry alerts, however I only receive expiry from 1 location, not from the other locations.

I checked all locations and 3 of them have products that are expired or gonna expire in the next 30 days.

Is there some option i’m missing?

You need to enable notifications at the Location Type level (for all locations of that Location Type) or for each location you’d like to receive notifications (if there are some locations that are overriding the default supported activities).

Admittedly, the usability around User roles and Location supported activities is poor to quite poor and could use some work (i.e. a feature to show you what to expect with different settings, allowing a dry run session, etc). For now, you need to flail around until you get it right.

I changed some settings i will wait till 00:00 to see if it works.

So I tested an other setting, but still not working.

This is one of the locations that is not sending any emails:

This location is sending emails:

I don’t have any ideas off the top of my head, but I’ll create a bug report to investigate further.

The only reason an email would not be sent (if notifications are enabled) is if the report is empty. So see if this setting helps.

openboxes.jobs.sendStockAlertsJob.skipOnEmpty = false

NOTE: This needs to be added to openboxes-config.groovy (not openboxes-config.properties) since Java / Groovy does not handle boolean values properly when they are included in .properties files.

Also, you might be able to trigger the emails on-demand using an admin feature under Configuration > Background Jobs.

  1. Login as a Superuser
  2. Click on the Cog icon in the upper right corner to display the Configuration menu
  3. Click on the Administration > Settings menu option
  4. Click on the Background Jobs tab
  5. Click on the Trigger button next to the Send Stock Alerts Job label

If, for some reason, that doesn’t trigger the background job, you can create a trigger under the Quartz admin page.

  1. Precondition: Assuming you are on the Background Jobs tab

  2. Click on the Background Jobs button at the bottom of the page

    image

  3. Click on the link for the SendStockAlertJob row

  4. Enter a cron expression to trigger the job

    image

  5. Click the Add trigger button

  6. The Triggers table should be updated with the newly created trigger.

  7. After you have triggered the job, I would recommend deleting the trigger.

I’ll leave the writing of the cron expression as an exercise for the reader since it’ll depend on the time it is near you. Just note that Quartz will likely be using UTC as its timezone.

I would also recommend not using this cron expression * * * * * ? as it’ll trigger the job once a second forever.

As an example, It’s 2:01 PM CDT here in Milwaukee, so I just created a cron trigger for “Every hour at the 5 minute mark” which will execute next at 2:05 PM CDT.

0 5 * * * ?

… which turned into this trigger. See the Next fire time to make sure it’s going to trigger soon.

Note that the Quartz cron expression might be slightly different (more expressive?) than the regular cron expressions, so review the Quartz documentation to get a better understanding of what is expected.

There are probably some utilities on the web to help you generate a Quartz cron expression, but I don’t have any to suggest at the moment.

Justin