Support

Home Forums Event Espresso Premium Automated Post Event Notification

Automated Post Event Notification

Posted: February 10, 2023 at 2:51 pm

Viewing 15 reply threads


zcsiteadmin

February 10, 2023 at 2:51 pm

Hello,

I set an automated post-event notification for an event, and it went haywire. It sent the post-event messages 3x a day for 3 days. Customers were understandably annoyed. Is there something I can check/change to ensure this doesn’t happen again?

It was set to send a notification 1 day after the event.

Thanks in advance.


Garth

  • Support Staff

February 13, 2023 at 8:49 pm

Hi there,

Do you have records in the Event Espresso > Messages > Activity that shows that multiple messages were sent? Or how do you know those messages were repeated?

I’ve not seen that happen and in order to prevent that from happening we’ll need to try and see if you can replicate it.

Can you create an event, add your self as an attendee, then set up that same notification for just you in that one event? Hopefully you can trigger that to happen to just you.

If it happens again I’d look at WordPress Cron and the cron schedule to make sure it’s running correctly. Your host can probably help with that.

If the situation doesn’t happen again, then it will require more testing.


zcsiteadmin

February 14, 2023 at 8:32 am

Hi,
Yes, in the Messages I can see for every person who was an approved attendee that three emails were sent per day each day. We also received complaints.

I have created a new test event and registered myself to see if this happens again. The post event notification will trigger starting tomorrow, so we’ll see what happens.

Just a note – we’ve been using the pre-event for months with no problem. We’ve just added the post-event add-on.


Tony

  • Support Staff

February 15, 2023 at 7:57 am

Hi there,

Just to confirm, are you using the Post Event or Post Datetime notifications?

It sounds like you are using post event but I just wanted to confirm first.


zcsiteadmin

February 15, 2023 at 12:09 pm

Yes, you are correct, it is a Post Event notification.


zcsiteadmin

February 16, 2023 at 8:40 am

Ok, two days have passed and I haven’t received a post-event notification at all this time. And I used the same template. I actually duplicated the problematic event. Only difference is that I made it private so it wouldn’t display with the other events our visitors saw on the main page and calendar.
That shouldn’t affect messages to registrants, right?


zcsiteadmin

February 16, 2023 at 2:41 pm

By the way, the Not Approved, Approved and Upcoming Event Automated messages all work just fine.


Tony

  • Support Staff

February 17, 2023 at 1:02 pm

Only difference is that I made it private so it wouldn’t display with the other events our visitors saw on the main page and calendar.
That shouldn’t affect messages to registrants, right?

It actually will do, the query for AUEN is looking specifically for events with a status of publish or sold_out. When you set the event to be privately published it changes the status to be private, so it won’t work with AUEN at that point.

I’ve managed to reproduce this and currently working on a fix but I can tell you how to test the above yourself if you’d like.

Install WP Crontrol on the site: https://wordpress.org/plugins/wp-crontrol/

Open up Tools -> Cron Events and look for ‘AHEE__EventEspresso_AutomatedEventNotifications_core_tasks_Scheduler__check’

Leave that open in that tab.

In a new tab open up Event Espresso -> Messages, take note of the last message triggered.

Click Run now on the above cron task, then refresh messages, there should NOT be a AUEN message triggered.

Edit your event and set it to be published publicly.

Now repeat the above and run the cron task… take a look in messages, it SHOULD trigger a message.

Run the cron task again…. it should NOT trigger a message, but in this case it will. Each time the cron task runs it will trigger a new message to send.

Normally there is a meta value set to exclude specific events/datetimes and it looks like that may be missing here.

I’m investigating this further and will post any info found.


zcsiteadmin

February 17, 2023 at 1:20 pm

Ok, before I make a lot of people mad – there are multiple events scheduled on my system… If I click “run” on the cron task, will it send messages to everyone?


Tony

  • Support Staff

February 17, 2023 at 4:24 pm

If I click “run” on the cron task, will it send messages to everyone?

Only if those people are due to get a message anyway.

That cron automatically runs in the background roughly every 3 hours anyway, the run now button just lets you run it on your own.

But, I’ve found the problem and will be pushing an update for it on Monday (we don’t push updates on Friday as support may not be available over the weekend).

If you are comfortable with FTP/File Manager on the server I can tell you what you need to change:

\wp-content\plugins\eea-automated-upcoming-event-notifications\domain\services\commands\message\PostEventNotificationsCommandHandler.php

On line 282 should be something like:

$where = array(
    'Datetime.DTT_EVT_end' => array('>', time()),
    'Extra_Meta.EXM_key'     => $meta_key,
);

Change the > to be <

That should fix the issue for you.

You can confirm that by doing the above using your test event first, then as soon as you change the above the email should stop being triggered when you click the Run now button again.


zcsiteadmin

February 20, 2023 at 7:40 am

Ok, I’ll make that change today. Over the weekend I received 5 notifications for the event I enabled Post notifications on. I’ll change this, and retest.


Tony

  • Support Staff

February 20, 2023 at 8:48 am

So what’s happening is the query that’s looking for events that have already been processed for the POST notification has the wrong condition, it’s looking for events with an Event End in the future.

Theres basically 2 queries that run.

Query 1 – get all the events that match the schedule criteria.

Query 2 – get the events that match the criteria that have already been processed and exclude them from the above.

Query 2 is missing the events that match the current conditions and have already been processed, so each time the POST notifications run they pull all the events in that match and the current ones that have been processed aren’t excluded, that’s why you get multiples. Each time the cron runs throughout the day where the criteria matches up it triggers another email.

I’ll be pushing an update for the add-on with that change out today.


zcsiteadmin

February 20, 2023 at 8:53 am

Ok, thanks for the explanation. I just edited the file the way you specified. But to be sure, I’ll likely apply your update.


Tony

  • Support Staff

February 20, 2023 at 2:15 pm

The update has been pushed live.

If you don’t see it on your site just yet go to Event Espresso -> General Settings.

Make no changes and just hit save for an update check.


zcsiteadmin

February 22, 2023 at 12:24 pm

I seem to have only received one Post-Event notification. Thanks!


Tony

  • Support Staff

February 22, 2023 at 12:57 pm

Awesome, thanks for keeping us updated, I’m glad it worked.

Any further issues please let us know 🙂

Viewing 15 reply threads

The support post ‘Automated Post Event Notification’ 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