[Resolved] CRED form notification email (third time)
This thread is resolved. Here is a description of the problem and solution.
Problem: Some automatic email notifications are not being received.
Solution: Sometimes when the site is inactive for extended periods, the internal cron is not triggered and notifications are skipped. Set up a true cron that pings the site periodically so that the internal WP cron is triggered at regular intervals to prevent this issue.
This support ticket is created 3 years, 6 months ago. There's a good chance that you are reading advice that it now obsolete.
This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.
Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.
So in the notification code, that would look like this:
Dear [wpv-post-author format="meta" meta="first_name" item="%%POST_ID%%"],
your Listing [wpv-post-title item="%%POST_ID%%"] ([wpv-post-url item="%%POST_ID%%"]) is about to expire.
...
In WordPress, the first name field is not explicitly required, so there are cases where some Users might not see anything for first name. If you'd like to test these updates in a staging environment, I'll be glad to help troubleshoot. It might be best to create a staging environment with an empty database to prevent sending multiple messages inadvertently for existing posts, or do you have a different idea for preventing unwanted emails?
Dear Christian, thanks for your quick response, I will apply that template and give you feedback. I have one test listing which will expire in few days.
Let's please just leave this ticket open for this time.
this doesn't work, I'm honestly not sure is this something with my setup or the toolset is not sending email notifications to expired listings.
I will create in the following days a staging environment and give you admin access there. Will delete all users and listings. This will be an exact copy of the production site, but without data.
All listings are deleted, except one. That is my listing which was moved automatically to draft mode after expiration period, but the email wasn't sent.
I have activated private reply fields here so you can share login credentials. Please let me know where to find the Form on the front-end of the site so I can publish some test posts.
Okay I have logged in and created a test listing. I adjusted the expiration date to by 8 days from now: hidden link
Since the notification is set to be sent 7 days prior to expiration, I suspect we should see a notification triggered tomorrow. I will continue to monitor the Mail Log and give you an update the day after tomorrow, when we should have some results to discuss.
Christian, I have received notification from our staging site that your listing will expire. I'm not sure now why we have that issue on production site.
===
Dear Christian,
your Listing TS listing 13:46 (gabbtest.wpengine.com/listing/ts-listing-1346) is about to expire. You have 7 days to reset expiration date. After this time, your Listing will not be visible in Businesses for Sale page.
Best Regards
Georgia Association of Business Brokers
===
site design by Deal Studio
revision: v20210428
===
The environments are exactly same, I only deleted the other listings
Okay thanks for the update. It looks like the formatting issue is resolved by the latest changes - I see the author first name, post title, and post URL are included as expected in the notification.
I can think of a few reasons why the messages might not coming through in the live site.
1. There is not enough site traffic to trigger the WP cron on a regular schedule every day. Since the WP cron is only triggered when there is WordPress activity on the site, if nobody visits the site on the day when a notification is scheduled, the WP cron is never triggered and the notification is therefore never sent. Yesterday I visited the staging site several times to be sure the WP cron was triggered. If you think it is possible that the live site often goes a full day without WordPress traffic, a true cron job can help solve this problem. Usually true cron jobs can be set up in your hosting control panel. If you're not familiar with this process, you can ask your hosting company to help you set up a true cron job that loads the homepage of the site periodically. Once an hour should be sufficient. A true cron job works without requiring site traffic, and hitting the homepage will be sufficient to activate the WP cron periodically.
2. There could be a problem triggering the wp_mail function, or a problem with the email system on the server. Installing the Mail Logging plugin on the live site would help identify this issue. If a problem exists, the log will include an error message with a few more details relevant to each triggered notification.
3. The Forms notification check frequency "Once daily" is not sufficient based on the amount of site traffic. Increasing the frequency to once every hour could help here.
At any rate, installing the Mail Logging plugin on the live site could be helpful, as it will help you determine whether mails are being triggered but not received (possibly sent into a spam folder or blocked by some server-side security system), or not triggered at all.
thanks for the update. I contacted our hosting partner and they have enabled alternate cron on that environment, not on that staging which we have tested, but the real production site (www.gabb.org).
Here is they answer:
Support: Yeah, so it'll check for crons to run every minute
Me: Ok thanks, so I can answer them that on this env alternate cron is enabled and it will run every minute
Support: Correct 🙂
hidden link
As for the mail log plugin, it is enabled and I will check there if something happens in the meantime. And yes, the notification message now send all fields required.
Thanks again for your help and prompt support, I really appreciate it.
I think we can close this thread as we need to wait now for the clients feedback.