Skip to content
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

Do not send organiser reminders with "send X days after the camp ends" trigger if WordCamp didn't happen #970

Merged
merged 8 commits into from
Apr 29, 2024

Conversation

timiwahalahti
Copy link
Collaborator

@timiwahalahti timiwahalahti commented Jul 21, 2023

We sent organisers reminders with "send X days after the camp ends" trigger even if the WordCamp didn't happen. Especially during the pandemic, many WordCamps were put back to pre-planning but had dates in the tracker. This can also happen from time to time for various reasons.

The wcor_send_after emails were sent out due to the $pending_wordcamps query grabbing those emails, and in timed_email_is_ready_to_send function only checking the end date even the function is called from send_timed_emails for various different WordCamp statuses.

This PR adds a check against the status of WordCamp in timed_email_is_ready_to_send function for wcor_send_after trigger. Only public WordCamp statuses (in schedule, closed) do get the email.

Also, some minor code refactoring was done to make conditions easier to read and tests were updated for this scenario.

Fixes #496

Props @coreymckrill

How to test the changes in this Pull Request:

  1. Schedule some WordCamps with pre-planning statuses and past date(s)
  2. Run wcor_send_timed_emails cron job

Copy link
Contributor

@renintw renintw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested and Looks good. Thanks for some refactorings here!

@renintw renintw merged commit f5adc25 into WordPress:production Apr 29, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: ✅ Done
2 participants