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

Transparency Report email automation #1290

Merged
merged 5 commits into from
Apr 25, 2024

Conversation

renintw
Copy link
Contributor

@renintw renintw commented Apr 21, 2024

Fixes #1280

This PR adds a checkbox for admins and super admins to check to confirm whether the transparency report has been received. And integrates with the organizer reminder plugin, allowing users to set how many days after a camp ends a reminder email should be sent if the report has not been received.

How to test the changes in this Pull Request:

  1. Add 3 new Automated Reminders.
    • Content: random.
    • Who should this e-mail be sent to? The organizing team (typically [email protected]) & The Budget Wrangler.
    • When should this e-mail be sent? after the camp ends and no transparency report is received: 7 days & 14 days & 21 days.
  2. Create two WordCamps (A reminder must be added before adding a wordcamp; otherwise, the reminder will not be triggered.)
    • You don't need to fill out all the information, just remember to fill in the start date, end date, and the Budget Wrangler's email address; these can be entered arbitrarily. Also, fill in the URL and check the create a new site checkbox. Then Publish.
    • Check if there's a Transparency Report Received checkbox at the bottom of the WordCamp Information section.
      • Switch to different user roles and check if only super admin and an admin+wordcamp author can see the checkbox. (ie. make sure a wordcamp author can't see the checkbox)
  3. After WordCamps are created, change their status from Need Vetting to In Pre-Planning.
  4. In your first WordCamp, make sure the End Date is NOT set to 7 days ago. Then, run wp cron event run wcor_send_timed_emails --url=https://central.wordcamp.test/ in your docker container.
    • Remember not to set the End Date of the second WordCamp for 7, 14, or 21 days; leave it for future testing.
  5. Shouldn't see any email sent on http://localhost:1080/.
  6. Set the End Date to 7 days ago and run wp cron event run wcor_send_timed_emails --url=https://central.wordcamp.test/ again.
  7. Should see an email with the title and content you set in the reminder sent.
  8. Set the End Date to 14 days and 21 days ago respectively and run wp cron event run wcor_send_timed_emails --url=https://central.wordcamp.test/ again.
  9. Should see two emails with the title and content you set in the reminder sent.
  10. Now let's test the second case, which is when the organizer submits the transparency report, and then the super admin checks off the transparency report.
  11. In your second WordCamp, set the End Date to 7 days ago. Then, run wp cron event run wcor_send_timed_emails --url=https://central.wordcamp.test/ in your docker container.
  12. Should see an email with the title and content you set in the reminder sent.
  13. In your second WordCamp, check off the Transparency Report Received checkbox and set the End Date to 14 days ago. Run wp cron event run wcor_send_timed_emails --url=https://central.wordcamp.test/
  14. Shouldn't see any email sent.

Screenshots

Organizer Reminder
Screenshot 2024-04-23 at 02 20 18

Three emails received
Screenshot 2024-04-23 at 02 19 44

Transparency Report Received Checkbox
Markup on 2024-04-23 at 02:25:43

Four emails received
Screenshot 2024-04-23 at 02 26 59

@renintw renintw self-assigned this Apr 21, 2024
@renintw renintw added [Component] WCPT WordCamp and meetup post types, applications, trackers, mentors [Component] Central central.wordcamp.org [Type] Feature Request labels Apr 21, 2024
@renintw renintw requested a review from pkevan April 22, 2024 18:10
* The "Transparency Report Received" checkbox can only be checked or unchecked when the current user is admin or super admin.
* See https://github.com/WordPress/wordcamp.org/issues/1280#issuecomment-2058571557.
*/
if ( current_user_can( 'manage_options' ) ) {
Copy link
Contributor

@pkevan pkevan Apr 23, 2024

Choose a reason for hiding this comment

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

Not sure if you've tested this scenario but I've come across several times in the past where a user who isn't shown or displayed a field in this way can overwrite the field with a default value. Unsure if this is the case here, but wanted to mention it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for bringing that up! I hadn't thought of that case.
Just checked off the field and then updated the post using another user unable to see the checkbox, and it didn't overwrite.

@renintw renintw merged commit e9e6189 into production Apr 25, 2024
3 checks passed
@renintw renintw deleted the 1280-transparency-report-email-automation branch April 25, 2024 13:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Component] Central central.wordcamp.org [Component] WCPT WordCamp and meetup post types, applications, trackers, mentors [Priority] Medium [Type] Feature Request
Projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

Transparency Report Email Automation
2 participants