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

Revise email docs and update email configuration #1752

Merged
merged 8 commits into from
Jul 17, 2021
Merged

Conversation

czlee
Copy link
Member

@czlee czlee commented Mar 8, 2021

Will close #1751, once it's ready.

Notable changes:

  • Replaced config vars SENDGRID_USERNAME and SENDGRID_PASSWORD with just SENDGRID_API_KEY—this is more aligned with how personal SendGrid accounts should be used, and since we're dropping automatic provisioning of the SendGrid add-on, there's no need for us to follow their convention. Plan is to check for the old setting and for it still to function, but to show a warning on the tournament overview page.

More to come—may add more notes on other options to docs. Thoughts welcome while still being drafted.

czlee added 3 commits March 8, 2021 18:31
This deprecates SENDGRID_USERNAME and SENDGRID_PASSWORD. Since we're
no longer using the Heroku SendGrid add-on, we no longer have to
abide by this convention, and just specifying the API key is more
convenient.

Also, fix bug causing EMAIL_USE_TLS not to be recognized.
This moves SendGrid configuration instructions to the notifications
page of the docs.
@czlee
Copy link
Member Author

czlee commented Mar 12, 2021

Quick note while I remember:

  • This PR should add a deprecation notice that is displayed to users who are still using SENDGRID_USERNAME and SENDGRID_PASSWORD, since support for that will eventually be removed, and it is indicative of users who are using the Heroku add-on. (This is noted above, but I'm sure I'll forget next time I look at this if I don't add a to-do note.)

@czlee
Copy link
Member Author

czlee commented May 28, 2021

Random thought:

  • I think we can control the from email address from source code (as opposed to from DEFAULT_FROM_EMAIL), so it's probably not a bad idea to make this a proper Tabbycat setting and run some more intelligent checks/error messages when sending fails due to Sender Identity Verification or something like that.

@tienne-B
Copy link
Member

I think we can control the from email address from source code

Yes we can.

@czlee czlee force-pushed the feature/email-docs branch from bce05d3 to 1536665 Compare June 6, 2021 04:50
@czlee czlee force-pushed the feature/email-docs branch from 1536665 to e034720 Compare June 6, 2021 08:08
@czlee
Copy link
Member Author

czlee commented Jun 6, 2021

Current status:

  • This removes the auto-provision SendGrid, and changes the expected config var to SENDGRID_API_KEY, as indicated earlier.
  • It shows a deprecation message if it detects that SENDGRID_USERNAME is in use.
  • Docs are updated accordingly.
  • It makes an effort to catch the SendGrid Sender Identity error.

Caveats:

  • I don't know whether the Sender Identity error catch actually works, and I'm not sure how to test it because short of creating a new account I'm not sure how to generate the error. I think it's probably an SMTPResponseException but I couldn't say for sure. I've added logger.warning(..., exc_info=True) calls throughout the code catching test email errors to try to give us better visibility.
  • I haven't created the "from email" preference, because I realized as I was doing it that I wasn't sure whether to make it a site-wide preference or a tournament preference. My first instinct was tournament preference, but that would break the test email facility, which is a site-wide page. I'm inclined to leave this for a future PR/commit unless other devs think the answer here is obvious.

@czlee czlee marked this pull request as ready for review June 6, 2021 09:32
@tienne-B tienne-B merged commit ef39c12 into develop Jul 17, 2021
@tienne-B tienne-B deleted the feature/email-docs branch July 17, 2021 02:12
czlee added a commit that referenced this pull request Jul 18, 2021
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 this pull request may close these issues.

Update guidance for email configuration
2 participants