Opened 8 months ago
Last modified 3 weeks ago
#63135 assigned feature request
Testing and Debugging WP_Mail related topics
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Milestone: | Future Release | Priority: | normal |
| Severity: | minor | Version: | |
| Component: | Build/Test Tools | Keywords: | has-patch has-test-info |
| Focuses: | Cc: |
Description
How do you test and debug things related to WP_Mail with wordpress_develop?
Unless I'm missing something in the code, I think that having an optional runnable Mailhog instance could be pretty neat for testing and debugging purposes.
Maybe there are some other proposals or ideas that I would like to know, but meanwhile I will be uploading a patch with Mailhog idea.
Change History (24)
This ticket was mentioned in Slack in #core-test by sirlouen. View the logs.
8 months ago
This ticket was mentioned in PR #8555 on WordPress/wordpress-develop by @SirLouen.
8 months ago
#2
- Keywords has-patch added
This ticket was mentioned in Slack in #core-test by sirlouen. View the logs.
6 months ago
This ticket was mentioned in Slack in #core-test by sirlouen. View the logs.
6 months ago
This ticket was mentioned in Slack in #core-test by sirlouen. View the logs.
6 months ago
#9
@
6 months ago
- Keywords needs-testing removed
Test Report
Description
This report validates whether the indicated patch works as expected.
Patch tested: https://github.com/WordPress/wordpress-develop/pull/8555
Environment
- WordPress: 6.9-alpha-60093-src
- PHP: 8.2.28
- Server: nginx/1.27.5
- Database: mysqli (Server: 8.4.5 / Client: mysqlnd 8.2.28)
- Browser: Chrome 136.0.0.0
- OS: Windows 10/11
- Theme: Twenty Eleven 4.9
- MU Plugins: None activated
- Plugins:
- Amazon S3 Email Testing 1.0.0
- Test Reports 1.2.0
Actual Results
- ✅ Issue resolved with patch.
Supplemental Artifacts
#13
@
4 months ago
- Keywords needs-unit-tests added; dev-feedback removed
Switching into Mailpit. It providers a better API for testing.
I will set a little suite of integration tests to showcase this.
@mindctrl commented on PR #8555:
4 months ago
#15
@SirLouen is there anything left to do here?
@SirLouen commented on PR #8555:
4 months ago
#16
@mindctrl yeah this is still of phase 1.
But I'm using this mainly to drag it as a patch and test reports that need something relating with Mail component.
I don't think it will get through as-is right now.
@mindctrl commented on PR #8555:
3 months ago
#17
@SirLouen could you add a list of things left to do in the opening description? We have a 6.9 milestone and I'd love to help get it in the proper state for a committer to review/merge. I've needed local mail testing multiple times recently. WCUS Contributor Day is coming up and I know a few people willing to help.
@SirLouen commented on PR #8555:
3 months ago
#18
@mindctrl I think it's time to de-milestone this. I was confident that this could be a great addition to wordpress-develop, but for now it's not adding value in the line that is expected (according to one dev-chat some months ago)
My idea is to look to add extra value to this, but this is not going to happen anytime soon, and I seriously doubt it will make it on time for 6.9. This PR by itself is useful for someone like me that uses this PR like every other day, but useless for most of the people that seldom test anything—mail. Hope to see it merged somewhere in the future, but much work is needed to consider it a potential merge (mainly creating integration tests in PHPUnit that make use of this service).
I've updated the milestone so we don't need to rush it anymore.
#19
@
3 months ago
- Milestone changed from 6.9 to Future Release
Moving into Future Release for the reasons stated above. No need to rush it for now.
#20
follow-up:
↓ 21
@
3 months ago
- Keywords close added
I think this may be a duplicate of #48060. While that originates with a different suggestion, the most recent on the ticket is for MailHog.
#21
in reply to:
↑ 20
@
2 months ago
- Component changed from Mail to Build/Test Tools
- Keywords needs-unit-tests close removed
- Milestone changed from Future Release to 6.9
- Owner set to SirLouen
- Status changed from new to assigned
Replying to jorbin:
I think this may be a duplicate of #48060. While that originates with a different suggestion, the most recent on the ticket is for MailHog.
Thanks for that one, it true, and it's good to see that it has been solicited and there is plenty of interested.
But this ticket is much more advanced in progression in all regards, so I'm going to be closing that in favor of this one. I'm moving back to 6.9, I really want to see this anytime soon. It's definitely a pain to test for the Mail component.
I've been using this for over 4 months (patching on demand). The switch from Mailhog to Mailpit is significantly favorable. Maybe some tweaking is required to be more compliant with the current state of docker-composer.yml, although we have to keep simple the container name to be easy to target with the PHPMailer SMTP injection.
Adding support for a mailhog container on demand with the env variable:
LOCAL_MAILHOGPatch Testing instructions:
LOCAL_MAILHOG=falsetoLOCAL_MAILHOG=truein your.envfilenpm run env:startA) Go to http://localhost:8025/
B) You can run in your wordpress-develop container
And it might result in something like:
C) You can do further tests, like sending an email with a plugin that uses the local mailhog hostname
For example this one: https://github.com/SirLouen/amazon-s3-email-testing/archive/refs/tags/1.0.0.zip
Trac ticket: https://core.trac.wordpress.org/ticket/63135