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

When creating users, "Create and Send Email" doesn't handle email sending errors nicely #9309

Closed
jondcampbell opened this issue Jan 11, 2024 · 0 comments · Fixed by #9382
Closed

Comments

@jondcampbell
Copy link

jondcampbell commented Jan 11, 2024

Bug description

I expect when I try to send an email for user creation it would let me know that the user was created and the email was not sent or give me some next steps. Right now I would just be stuck at this screen (plus an error in the bottom left corner) and not know what to do next:
CleanShot 2024-01-11 at 10 39 03

How to reproduce

I use the user creation wizard at /cp/users/create to create a new user and the last step is customizing the invitation. I have the "Send Email Invitation" toggled on and click the Create and Send Email button and then an error pops up (something about the email sending host/port being wrong). That's fine but at that point if I hit the Create and Send Email button again it gives me a different error "The given data was invalid" because the system knows it has already created a new user for me. I can see the user .yaml in my site files, but as someone using the control panel I would have no idea that the user was created.

It's great that it let me know there was an issue sending the email but at this point the user is created, it should tell me that and let me know it just couldn't send the invitation. Even if I turn off the "Send Email Invitation" toggle and click the Create User button it still gives me the "The given data was invalid" error message because the user is already created so it can't create it again.

Logs

[2024-01-11 10:35:29] local.ERROR: Connection could not be established with host "localhost:1025": stream_socket_client(): Unable to connect to localhost:1025 (Connection refused) {"userId":"c44ac742-05b5-4627-80e5-608236125423","exception":"[object] (Symfony\\Component\\Mailer\\Exception\\TransportException(code: 0): Connection could not be established with host \"localhost:1025\": stream_socket_client(): Unable to connect to localhost:1025 (Connection refused) at /Users/joncampbell/Local Sites/multitest/app/vendor/symfony/mailer/Transport/Smtp/Stream/SocketStream.php:154)

Environment

Environment
Application Name: International Students
Laravel Version: 10.40.0
PHP Version: 8.2.14
Composer Version: 2.5.5
Environment: local
Debug Mode: ENABLED
URL: multisite.local
Maintenance Mode: OFF

Cache
Config: NOT CACHED
Events: NOT CACHED
Routes: NOT CACHED
Views: CACHED

Drivers
Broadcasting: log
Cache: statamic
Database: mysql
Logs: stack / single
Mail: smtp
Queue: sync
Session: file

Statamic
Addons: 9
Antlers: runtime
Stache Watcher: Enabled
Static Caching: Disabled
Version: 4.43.0 PRO

Statamic Addons
aryehraber/statamic-impersonator: 2.6.0
kadegray/statamic-phone-number-fieldtype: 1.0.3
rias/statamic-address-field: 1.1.0
spatie/statamic-responsive-images: 4.1.1
statamic/collaboration: 0.8.1
studio1902/statamic-peak-browser-appearance: 3.3.4
studio1902/statamic-peak-commands: 4.0.0
studio1902/statamic-peak-seo: 8.0.0
studio1902/statamic-peak-tools: 4.2.0

Installation

Starter Kit using via CLI

Antlers Parser

None

Additional details

Multisite

@duncanmcclean duncanmcclean changed the title Create and Send Email doesn't handle email sending errors nicely When creating users, "Create and Send Email" doesn't handle email sending errors nicely Jan 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants