Support

Home Forums Event Espresso Premium WP Cron and WP Fusion

WP Cron and WP Fusion

Posted: May 13, 2021 at 4:33 pm

Viewing 7 reply threads


wnyhe

May 13, 2021 at 4:33 pm

Hi
So…..
We installed WP Fusion so we can integrate to hubspot. We found a bug. Email notifications to registrant did not include the date of the event only the times. We contacted wp fusion. We wemt through the process of deactivating plugins one by one
Nothing worked. In an attempt to not get into a finger pointing match betwee ee and wp fusion, we tried a couple of things and uncovered a fix AND a problem
We had the message settings set to “Send on the same request” When I changed to send on a “seperate request” everything works as it should BUT
1. Emails are not getting generated and sent automatically
2. Is there a Cron job we can run on the server that forces this task every few minutes? If there is, would this put a strain on our vps server?
3. How long is it supposed to take before emails are generated and sent? Does it coincide with WP cron and dependent on traffic?

Not having a date in an email notification is a show stopper. AND we need emails sent in real time not 1 hour later or the next day.
Are there any work arounds? I have tried putting the date time short code in different areas of the message, I’ve also tried different short codes to populate the date time.
Please help. We really need this data going to hub spot but also need emails sending in real time. Thank you!!!


Tony

  • Support Staff

May 14, 2021 at 4:01 am

Hi there,

So just to clarify, the emails you are referring to with no date are the EE messages? For example, the ‘Registration Approved’ email sent by EE?

If you go to Event Espresso -> Messages -> Message activity, can you see the email there with no date?

We had the message settings set to “Send on the same request” When I changed to send on a “seperate request” everything works as it should

This is strange as that setting should make no difference to the content of the email itself.

The message is sent in the same way with both settings (through wp_mail()), just the method used to get to sending the message is different.

Do you have WP_CRON disabled on the site?

I have tried putting the date time short code in different areas of the message, I’ve also tried different short codes to populate the date time.

Which message type are you editing here?

Which context within that message type? (Event Admin, Registrant, Primary Registrant) For details see: https://eventespresso.com/wiki/messages-system-working-with-message-contexts/

Before moving onto workarounds for this I’d like to try and reproduce the problem to see if its something we need to fix.

The EE message queue system does indeed rely on WP_CRON and so is tied to traffic hitting the site (although you can also set up a cron to trigger wp-cron every X minutes).


wnyhe

May 17, 2021 at 10:23 pm

Tony you are a dream
1. Yes they ARE EE messages
2. WP Cron is not disabled, we just installed the controll plugin to watch things t up.
3. The automatic “Registration Approved Messages” are missing the dates
4. After some investigating, the Cron for EE triggers every 5 minutes regardless of traffic. Just what I’m seeing in control. I was reluctant to edit this jobs on the server.
5. We absolutely see the messages in the Message center with missing dates
6. We contacted WP fusion and they pointed to EE. I don’t want to do the finger pointing thing, so we did do a work around for now.
HOWEVER, it would be great to have these sent in real time.
I can give you access to the site if you want. Things seem to be working with the 5 minute delay. Not ideal but at least people get the dates in their emails.

THANK YOU FOR THE RESPONSE! I’ve been in the site testing with this work around and it appears good but I’m very nervous about stability and consistancy.


Tony

  • Support Staff

May 19, 2021 at 4:06 am

1. Yes they ARE EE messages

Thank you.

2. WP Cron is not disabled, we just installed the controll plugin to watch things t up.

Ok, just with you saying the messages were not generating/sending this would be the first thing to check.

3. The automatic “Registration Approved Messages” are missing the dates

From all contexts? (Event Admin, Registrant by default)

You said you’ve tried using the shortcodes in various sections, where are you loading them now?

If the Registration Approved Event Admin context doesn’t show the dates, lets start with that one.

Event Espresso -> Messages -> Default message templates -> Registration Approved -> Edit Event Admin. Where are the dates set to load? I’ll see if I can reproduce this locally.

4. After some investigating, the Cron for EE triggers every 5 minutes regardless of traffic. Just what I’m seeing in control. I was reluctant to edit this jobs on the server.

WP_Cron (and therefore any tasks assigned within it, like EE’s message crons) can’t trigger without traffic unless you already have a ‘real’ corn on the server set to trigger wp-cron.

If cron’s are currently working fine, just leave them alone for now. The important part was confirming that WP_Cron tasks were indeed running as it sounds like they may not have been.

5. We absolutely see the messages in the Message center with missing dates

Ok, thanks for checking. In short this confirms that something isn’t parsing the email after it’s sent which is then accidentally removing the dates.

6. We contacted WP fusion and they pointed to EE. I don’t want to do the finger pointing thing, so we did do a work around for now.

I understand, the problem is that the most likely difference between my site and yours is WP Fusion, so it could be the case that something is happening when that plugin is in use that breaks the message generation.

I’ll see if I can narrow it down any as we generally try to avoid the whole “it’s X plugins problem” as much as we can, sometimes that’s not possible but we’ll at least investigate.

THANK YOU FOR THE RESPONSE! I’ve been in the site testing with this work around and it appears good but I’m very nervous about stability and consistancy.

I think it’s important to point out here that the Message Queue system in itself is not a workaround, I understand you mean that in the sense of how you’re using it right now but that system isn’t considered unstable but rather it was designed to run the way it is now.

The ‘send on same request’ setting is the ‘original’ method EE used to generate emails, in short when your user completed a registration and triggered emails, those emails would generate and send on that same request that triggered them (the user’s request). Generally thats fine, it adds a little to the page load but no one is the wiser, until… you start adding large numbers of registrations in a single group (more emails) and/or slow mail server responses (longer and longer page loads for your user waiting for the email to send). Any errors from the mailserver can also prevent the users request from completing so they don’t end up loading the page etc.

The ‘message queue’ system was added into Event Espresso to prevent those issues and it is the default setup for Event Espresso now, that’s the ‘send on separate request’ option. It means that when your user’s request triggers an email, that request doesn’t generate and send the email, it adds a row to the queue with minimal details needed to generate the email(s). Meaning the user’s request is impacted very slightly and all of the email processing is then done away from the user. ‘Payment’ related emails (payment received/declined etc) skip the queue and send immediately as they are considered a priority, but generally the 10mins it takes for registration emails to come through doesn’t cause issues.

Again I’m more than happy to investigate this as that setting should not be causing dates to go missing in the emails, but using the message queue system within EE is a feature rather than something you should see as unstable. The emails can be made to consistently work through the queue at 5 min intervals using a real cron on the server to trigger wp_cron every 5 mins if thats needed.


wnyhe

May 20, 2021 at 1:39 pm

Tony thank you for the response
I didn’t set up any special cron jobs yet. I installed a plugin called “Control” so I could watch the cron jobs run. EE Message Cron says it runs every 5 min.
What am I missing?
I haven’t changed any settings on the server, the only thing I did was install control and change message settings to “send on seperate request”
We had that setting in the begining and email was not sending, ever…. so I put it to that.
Now it seems to be sending, but I didn’t change anything on server or in wp config
I’m nervouse because in the begining this message setting didn’t work “send on seperate request”
It is DEF the wp fusion causing the dates to be removed. However, the plugin is 250.00 a year and it says it’s “integrated” with EE for hubspot. To me, the “integration” doesn’t work as it should.


wnyhe

May 20, 2021 at 1:54 pm

Tony can you please login as admin and investigate before the WP fusion 30 days is up for a refund…. I”m super uncomfortable. How do I get you login creds?


wnyhe

May 20, 2021 at 1:59 pm

Here’s what the cron says AHEE__EE_Messages_Scheduler__generation
EE_Messages_Scheduler::batch_generation() This is the cron time interval for EE Message schedules (defaults to once every 5 minutes)
3 minutes 12 seconds EE_Messages_Scheduler::batch_generation() This is the cron time interval for EE Message schedules (defaults to once every 5 minutes)


Tony

  • Support Staff

May 20, 2021 at 2:47 pm

I didn’t set up any special cron jobs yet. I installed a plugin called “Control” so I could watch the cron jobs run. EE Message Cron says it runs every 5 min.
What am I missing?

WP Control is showing you the WP_CRON schedule task that Event Espresso sets up on your site, we add a task to run every 5 minutes so what you are seeing is the task we added with the description we added for how often we want it to run but that doesn’t mean it is running every 5 mins due to how WP_CRON works.

The fact that you are getting the emails sending on your site means that it is working but you can’t simply view WP Crontrol to get the full story for WP_CRON.

To explain, WP_CRON is a ‘sudo’ schedule, its works by checking to see if a task is due to run every time a user hits the site. So with every page load, WordPress (in the background) checks for any tasks that are due to run, which means it is reliant on traffic to function. We say ‘add this task to run every 5 mins’ (which is what you see in WP Crontrol) and then every time a check is done it will see if the time between the last run and now is 5 mins, if it’s 5mins or more, it runs the task. No traffic for 15 mins means the task takes 15 mins to run, the next run could happen 5 mins later, or an hour later, depending on traffic.

If you need consistent timings a ‘real’ corn job can be set on the server which basically runs the same check as above but on a proper schedule set on the server itself (say every 5 mins).

We had that setting in the begining and email was not sending, ever…. so I put it to that.
Now it seems to be sending, but I didn’t change anything on server or in wp config
I’m nervouse because in the begining this message setting didn’t work “send on seperate request”

There are many reasons for WP_CRON not running and unfortunately (or fortunately) as it’s running correctly now we can’t troubleshoot why it wasn’t running.

Tony can you please login as admin and investigate before the WP fusion 30 days is up for a refund…. I”m super uncomfortable. How do I get you login creds?

Tony can you please login as admin and investigate before the WP fusion 30 days is up for a refund…. I”m super uncomfortable. How do I get you login creds?

We can, but as this isn’t an issue with EE itself you would need to purchase a support token for this. Even then I can’t guarantee a fix as I have no idea what WP Fusion is doing here and whilst I’m not simply going to point the finger at them, EE works with the above setting without WP Fusion and you seem sure its that plugin causing it so the fix will likely be on their end, although I’ll happily investigate further.

Viewing 7 reply threads

The support post ‘WP Cron and WP Fusion’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso