Skip to content

Add Email Testing documentation to handbook#118

Open
ozgursar wants to merge 10 commits intoWordPress:trunkfrom
ozgursar:add-email-testing-documentation
Open

Add Email Testing documentation to handbook#118
ozgursar wants to merge 10 commits intoWordPress:trunkfrom
ozgursar:add-email-testing-documentation

Conversation

@ozgursar
Copy link
Copy Markdown
Collaborator

Summary

This PR adds a new "Email Testing" page to the handbook that explains the importance of testing WordPress core transactional emails and provides two methods for capturing emails during testing.

What's included

  • Explanation of why email testing is important for WordPress core
  • Two email capture methods:
    1. Email Logger plugin (works on local environments and WordPress Playground)
    2. Mailpit (for local development with Docker)
  • Step-by-step setup instructions for both methods
  • Screenshots demonstrating both tools
  • Ready-to-use WordPress Playground link with the Email Logger plugin pre-installed

Why this matters

Without proper email testing mechanisms, transactional emails triggered during testing either fail silently or get sent to real addresses, making it difficult to verify that core WordPress functionality works correctly. This documentation helps testers capture and inspect emails to ensure proper triggering, content, and formatting.

@ozgursar ozgursar linked an issue Feb 12, 2026 that may be closed by this pull request

2. Run the command `docker compose up -d mail` in your terminal
3. Test access to Mailpit at `http://localhost:8025/`
4. Add the following snippet to your `functions.php` or via [Code Snippets](https://wordpress.org/plugins/code-snippets/) plugin
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Add the following snippet to your functions.php doesn't specify which functions.php file. Could you update this to mention the active theme's functions.php to avoid confusion?

Suggested wording:

Add the following snippet to your active theme's functions.php file.

Copy link
Copy Markdown
Collaborator Author

@ozgursar ozgursar left a comment

Choose a reason for hiding this comment

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

I've completed the suggested wording changes.

Copy link
Copy Markdown
Collaborator

@nikunj8866 nikunj8866 left a comment

Choose a reason for hiding this comment

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

Thanks @ozgursar LGTM!

@3kori
Copy link
Copy Markdown
Collaborator

3kori commented Mar 26, 2026

All comments have been addressed, this LGTM!

Copy link
Copy Markdown
Collaborator

@nikunj8866 nikunj8866 left a comment

Choose a reason for hiding this comment

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

@juanmaguitar
Copy link
Copy Markdown
Collaborator

@ozgursar
Copy link
Copy Markdown
Collaborator Author

@ozgursar It needs to be added to the handbook-manifest.json. See: https://github.com/WordPress/test-handbook/pull/110/changes#diff-43b4dcabac07f1fdc2d3c98e5b9584ec7400522cb065eebef508235a8c8363c5 for the reference.

@nikunj8866 I added email testing to the handbook-manifest.json

Copy link
Copy Markdown
Member

@huzaifaalmesbah huzaifaalmesbah left a comment

Choose a reason for hiding this comment

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

Great documentation @ozgursar! This is really helpful for testers. I've suggested some minor changes.

@ozgursar
Copy link
Copy Markdown
Collaborator Author

For testing emails with WP Studio, maybe is worth to also mention this tool by @jonathanbossenger https://github.com/jonathanbossenger/wp-mail

@juanmaguitar This would be a good addition to the documentation. I don't have any experience with WP Studio and would like to get some help with adding information about this tool.

@ozgursar
Copy link
Copy Markdown
Collaborator Author

Great documentation @ozgursar! This is really helpful for testers. I've suggested some minor changes.

Thank you for reviewing @huzaifaalmesbah. I committed your changes.

@ozgursar
Copy link
Copy Markdown
Collaborator Author

For testing emails with WP Studio, maybe is worth to also mention this tool by @jonathanbossenger https://github.com/jonathanbossenger/wp-mail

@juanmaguitar I added WP Mail as the third tool for mail testing. But I'm not sure whether we should call it WP Mail or wp-mail. Can we get feedback from @jonathanbossenger?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Proposal to Add Email Testing Documentation

6 participants