-
Notifications
You must be signed in to change notification settings - Fork 368
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Job Alerts not sending #2768
Comments
Hi @joewa1980! Could you start a support ticket for this at https://wpjobmanager.com/support/, and send over more details about your site setup? Most importantly the host, other plugins, e-mail sending service used. We are not seeing this issue on other sites or on test sites, so it could be something specific to those sites. Some other things to check:
|
Thanks @yscik. A support ticket was created this morning. Our email sending service isn't relevant at this stage as the emails aren't being created to even get to the point of being sent by our provider (MailGun). Alert Duration is blank as we don't want them disabling at any point. Oddly enough though they were all disabled this morning so we re-published them all. Job creation is handled by our custom Gravity Forms integration so we use their email notifications for new pending jobs. I disabled the paid for Smyles plugin which helps with more options for job alerts, and takes over command of the job-manager-alert hook, and when disabled I did in fact receive my own job alert via WP Job Manager... however, none of the other alerts were triggered which is odd... and also my own alert was suddenly in a disabled state when I checked it this evening. Last updates: |
Are the alerts showing as active ("published") in WP-Admin -> Job Manager -> Job Alerts?
If not, could you check what value is set for the Alert Duration setting?
Does downgrading to WP Job Manager Version: 2.2.1 fix the issue?
|
Thanks for the extra details! Just checked and it's indeed a new bug with the alert duration, it disables the alerts right away when it's blank or 0. We are just preparing a release, I'll make sure a fix for this is included. Meanwhile setting the Alert Duration to 1000 or something should fix the issue. |
Thanks @yscik - that's reassuring, I'm not going mad seeing these auto-disabling alerts! The main issue now is the sending of job alerts which remains outstanding. I've tested adding a new job (using the standard WP Job Manager shortcode [submit_job_form] rather than our usual Gravity Forms integration) to test if WP Job Manager is out sending ANY emails. An admin email with the subject, "New Job Listing Submitted:" was received successfully. So currently it seems that it's an issue solely with the Job Alerts extension. If there's a previous version available I can try rolling back to that and see if emails are triggered - the job-manager-alert Cron is showing up as it should, but is not triggering the generation of emails to send. Other non-WP Job Manager Job Alerts site emails are being sent successfully as usual. Extra information, it might be useful: Cron event |
I believe the two are connected: the alerts are not sending because they got disabled (even if the cron job is still there). If you re-published all the alerts, they should start sending, but let me know if I'm misunderstanding and it keeps happening even to published alerts. |
All alerts were republished first thing today, still no action. A client has since posted a job, no alerts are going out. I added a new alert to see if a newly created/published one would trigger the email alert for that account, alas no. |
Are they not sending when manually running the the cron hook via WP Crontrol or a similar debug plugin, or waiting for their scheduled time? Note that an alert is only sent out daily (or less often depending on the frequency it's set to), so creating a job wouldn't trigger them right away. |
We have a 3hr frequency trigger using this snippet. They're not sending when manually running the cron hook via WP Crontrol - but I'll give it a few hours to see if the custom frequency triggers them. I can see one is scheduled to run in around 45mins. |
I can see the Cron for my own alert ran, the time has now reset to the next scheduled event. Nothing was sent. No emails for anyone else's either. |
It's like the plugin is running a Cron for each alert that is set up by each user... but decides that nothing matches for some reason, so it doesn't send out an email alert... yet all of them have at least job type and category selected, and worked for years only a couple of weeks ago. |
I disabled third-party WP Job Manager - Emails, Version 2.11.5 (14 December 2023) and managed to get three job alerts generated and sent at the time they were set for... then the 3.1.0 Job Alerts update came through today and even though hundreds of alerts are lined up, they're seemingly being skipped and not generated or sent. Even setting the frequency to 60s, then creating a new alert yesterday to test if it would sent worked correctly. Today... not happening. |
For additional information, the send_count custom field within the alert I set up for myself has a value of 3, suggesting that the alert has been sent out 3 times. It hasn't been sent once, so I hope that might help narrow things down a little, as to what part of the chain isn't working? |
I've found when querying each user (and their associated alert), they are all empty and returning the error, "No jobs were found matching your search. Login to your account to change your alert criteria" which is found in wp-job-manager-alerts\includes\emails\class-job-alert-email.php Looks like the plugin is not matching any of the criteria that the alerts contain and assumes it's not a match for a job alert email. Can you think of why this might be happening? ALL alerts have the job type and categories set, either specific individual ones, or all job types and all categories. All should match the current jobs on the site.
|
The only times I can get this to send out an alert is with a new alert with no categories or keywords etc., and only one job type. It then sends out a giant list of all previous jobs - if I add a second or third job type it sends, but only those that match the first job type in the list. And again, a giant list. There are hundreds of alerts but only 2 sending to 2 of our users. Both have gone out the past 3 days, with long lists of all previous jobs. Really struggling with troubleshooting this. It all worked beautifully just two weeks ago. |
Thanks @joewa1980, that gives a good hint of what might be wrong. I'll look into the query around tags/categories, maybe we changed something there. Just to make sure, you don't have any snippet active that might hook into the query? |
We have a 3hr frequency trigger using this snippet from your repository, but no others. The WP Job Manager - Emails plugin we use (were using), Version 2.11.5, 14 December 2023, uses your hook to send out alert emails but it's been disabled for this testing as it wasn't allowing ANY alerts to be sent out when it was activated. I guess something has changed with your core plugins affecting their plugin since their last update. If you could look into the query for job types as well that would be great as there's something funky going on that's really difficult to troubleshoot from this end. I've been unable to work out a failsafe method that consistently creates and sends alerts. The last time we had successful alerts go out was at the beginning of February (when the last job went live). We've had 4 jobs go live since 16 February without any correct alerts being sent. |
This found in our error log might well be useful.
Line 228 is at the end of this from class-notifier.php:
|
Looks like that error is coming from the WP Job Manager Emails plugin, but from a Preview e-mail action where an alert was somehow not selected — shouldn't be related to regular sending. But let me know if you find a similar error in the logs. While that plugin should still work, I'd disable its alert e-mail for a few days and test using the default one only. I wonder if the problem could be related to the 3 hour frequency and some timezone issue, though that part of the query hasn't changed either recently. Do you have alerts on longer frequency that were not being sent? Do any matching jobs show up if you click 'Results' in the my alerts frontend (the page with the [job_alerts] shortcode) as a user, or when sending manually from there with 'Send now'? |
"Results" button shows a list of jobs according to the criteria set (albeit the full list of jobs ever published), and the "Send Now" button correctly manually sends the email to the user (with the long list again, from [email protected]). Ah yes, well spotted. The WP Job Manager Emails plugin was activated for testing purposes to see what output would be generated for each alert, but has been off the rest of the time. It is off and emails are still not being sent out by the core plugin. It should be noted the usual hook was in use for the email previews, which worked just a few weeks ago. Their error shows a null value for get_matching_jobs(). At the moment any new or updated alerts are set to 60 seconds for testing purposes, only a couple get through as explained earlier on the GitHub thread (usually when no categories are selected, and only one job type... then a massive list comes through). All other alerts are not being sent for all frequencies and combinations of criteria... yet were working a few weeks ago. |
Did that add any insight? It seems only newly added alerts are triggering and sending out, but only matching the first of the job types (if multiple are selected), and ignoring the categories. The returned list is the full long list of jobs, rather than the specific newly added jobs. So it looks pretty confusing for users. Alerts from when the alerts were automatically disabled (incorrectly) by the plugin and then republished are not sending. Testing with the WP Job Manager Emails plugin on again shows the alerts not sending at all, even with new alerts. |
Okay, I've put it together now, this is stemming from the alerts being incorrectly disabled earlier. Republishing them didn't set up the cron schedule correctly. We've already started a fix for that one, should be fixed in a patch release this week. (As well as the issue of all the previous alerts being included.) For the job type / category filters not being applied correctly, I couldn't reproduce this one yet. Could you share what value do you have for these options in Job Manager settings?
For compatibility with WP Job Manager Emails, it's been working correctly during our tests, but maybe missing something. @tripflex is WP Job Manager Emails compatible with the latest WPJM (2.2.2) and Job Alerts (3.0.0+) changes? Did you have any reports about the job alert e-mails not triggering? |
In the process of setting up a staging site over the weekend, something in that process (using WP Staging) disables various things, such as Cron, WAF, and others. I began testing the staging site with all plugins disabled (except obviously for those needed, plus the default Wordpress theme... and the issue persisted... but... suddenly noticed that 400 emails had correctly sent on the live site via the job-manager-alert Cron. Looks like it needed some kind of reset to re-seat the alerts. Tentatively things are working well, but with WP Job Manager Emails disabled I've not been testing that. We've actually now reproduced the email we used their plugin for in the core plugin now, so don't need it, unless we can guarantee it plays nicely. So, progress. Just not 100% sure why. But not complaining! |
That's good to hear, I know cron setups can be tricky sometimes. Job Alerts does have a daily hook ( |
It's still a seemingly quite random - a new job went live yesterday and only 7 alerts went out. I'd estimate it should be at least 1000 matching alerts. Just can't see a pattern. |
On our sister site (virtually identical setup), a new job went live this morning, several hours before the daily check for most of the 650+ job alerts (since they were re-published a few weeks ago). Only one alert came through... and that was to me, oddly enough. No other alerts have been triggered. I can see the cron running as it should. Any thoughts? Maybe you could briefly look at our specific setup. |
Yeah that's very odd. Maybe it's a performance problem, the cron job timing out or running out of memory before it can process all the alerts. I'll try to do some benchmarks in a test environment. That should also show up in the logs, could you reach out to the host and check if maybe they have separate logging for cron, and what the max execution time and memory limit PHP settings are? |
11 March 2024 09:44 ELAPSED TIME: 5.6 ms Hook Name COMPLETED |
PHP time limit |
To help with testing, I set all alerts to draft then to publish, then cloned an existing job and published it as new. No alerts as yet but I'll report back. |
Thanks! Another thing to look for is a pattern on what filters (keyword, category, job type etc) the working alerts have vs the non-working ones. |
The only difference with the two that went out a few days ago was they were the newest to be published, that's why l've republished them all in the hopes that they'll actually become active. The first alert had all categories and all job types selected individually, the second alert had nothing specifically selected, so the alert effectively had all items automatically selected as per the other one. Many others have those same settings though. But just weren't newly published. |
Right then, 24hrs later, the same behaviour occurred - the same 3 alerts went out despite republishing all the alerts and adding a new job. The alerts went out to my admin account, a test user account with another email of mine, and one of our actual members. The same three users as before with the same alerts. Not any of the other hundreds of users and alerts. This is so baffling. |
Hey Joe! We just released a new version, Alerts 3.1.1 with a few fixes for matching jobs for the alerts and for cron scheduling. LMK whether the update fixes the issue on your sites. |
Excellent, I'm excited to try it! |
No success, unfortunately. We've had a new job on both sites that use this set of plugins, both send out oddly minimal sets of alerts - the second platform sent out 1 for the recent job (published over 24hrs ago), yet it was a broad matching job which should have triggered hundreds of alerts. |
@joewa1980 I know this has been 4 years ago, but did you ever manage to fix this ? I'm having similar issues. |
@atv2016 - Unfortunately it has always felt like an unpredictable black box of mystery, so after too many user complaints we stopped using it and had to create our own plugin to work for the specific setup we have, which ties into various hooks when particular events are triggered. |
Describe the bug
Job Alerts are currently not being triggered on two separate sites. This has been tested with two new jobs added, alert emails are not being triggered. No emails in our email log. Our two sites have around 1200 email alerts, none of the alerts have been triggered.
To Reproduce
Create a job, monitor the process of the job-manager-alert hook which should trigger emails to be sent out.
Expected behavior
Email alerts should send when a job is added (for the alerts that match the criteria).
Isolating the problem (mark completed items with an [x]):
WordPress Environment
The text was updated successfully, but these errors were encountered: