Update handling of error when email is not configured
Closed this issue · 3 comments
Add an environment variable, on by default that indicates that the email should not be sent. When that variable is set, suggest having a flow like this:
- Display a message "Email is not configured to be sent from this instance of the Identity Kit. Click "View" to see the email text that would have been sent, or Cancel to return to the administrator application."
If they click "View" either show the email in a window or open a new tab with the text of the email.
Let me know if that is difficult and there are other easier ways to handle this. We could have another option that says "...been sent, "Instructions" for information on configuring email, or Cancel...". The instructions link would go to an MD file in the repo.
@swcurran I am currently trying to handle development/demo mode on localhost and a possible deployment differently.
localhost: Running in development mode: to use the invite, go to http://localhost:1234/validate?invite_token=987-654-321
non-localhost: The invite email to email@example.com could not be sent. Are your SMTP server environment variables correct? To use this invite, navigate to: http://mydomain.com/validate?invite_token=987-654-321
The above messages are my initial pass at this and could be improved if necessary.
The reason to not displaying the email text in the window is - mostly - because it is quite long and it would require a fair amount of UI tweaks to get it to work properly, but it could be implemented with more time spent on it.
About the instructions: do we need an extensive guide about how configuring SMTP (and at this point every other piece of the app) or can we just point them to the environment variable section in the manage script and/or docker-compose?
Change this to: "Are your SMTP server environment variables correct?" to "If you expected the email to work please check your SMTP settings".
Other than that - all good. As to docs - just a section in the README that says where they are set. If there is a section, we can provide a link to it.