-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
feat: console command to send test email #3212
feat: console command to send test email #3212
Conversation
SonarCloud Quality Gate failed. 0 Bugs |
@mechanarchy is it possible you write a test for the command? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi!
I think that's a great idea.
It just missed some unit tests.
Sorry it took me a while - I haven't done a lot of PHP. But there are some basic tests now! Thanks for the approval :) |
Really great job @mechanarchy ! Thanks a lot |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See some improvements
…y/monica into 3128-send-email-from-terminal
Hi asbiin, I tried converting the string-variable concatenation into an interpolation like you suggested, but Psalm tests fails due to I looked at another command with a similar signature, and it is using string concatenation as well: monica/app/Console/Commands/SetupProduction.php Lines 63 to 69 in 5bf2626
I couldn't find a way around this after some searching and trial and error, so I think it may have to stay as concatenation unless you know a solution. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a great job, thank you @mechanarchy
This pull request has been automatically locked since there |
This PR will close #3128, it will also close #3890. It adds the
monica:test-email
command, to test whether email delivery is working. Prior to this, I had to repeatedly attempt to send password reset emails for testing (as did user @theexplosivegroup).The PR contains hard-coded strings: personally, I'm not sure there is value in translating them because they are strictly for testing purposes, and the content is largely irrelevant (you only care if you get the email).
Use as follows:
If no email is provided as an argument, the command will prompt you for one, but it does not verify that the email belongs to any registered user.