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

task: email configuration settings #90

Merged
merged 3 commits into from
Apr 29, 2024
Merged

task: email configuration settings #90

merged 3 commits into from
Apr 29, 2024

Conversation

tyliec
Copy link
Member

@tyliec tyliec commented Apr 6, 2024

Context

This pull requests enables the sending of FOI emails to public bodies.

Testing

Note: Brian has sent me the previous Postmark credentials, if you want to test this PR (and enable the sending of emails) reach out to me on Slack (codewithaloha.slack.com) and I shall provide them to you.

When testing this, both the ENABLE_EMAIL and the other related email configuration environment variables need to be set (depending on what you are trying to test). You should also not send a test email to a "real" public body on the development portal, as that will actually send a real email to that entity. You should create some sort of test public body and send all emails to that test entity.

Example FOI Email Received

Screenshot 2024-04-06 at 1 26 14 PM

Related Items

#89

@tyliec tyliec requested a review from a team as a code owner April 6, 2024 23:27
dinoboy197
dinoboy197 previously approved these changes Apr 7, 2024
Copy link

@dinoboy197 dinoboy197 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this looks like just a dev box config (and not for production), ship it!

Copy link
Member

@russtoku russtoku Apr 22, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It may be better to define a new class, say, EmailTest, to use for testing sending email via a real SMTP server. This would isolate the configuration from the normal development workflow and prevent confusion about its use.

The current setting has the EMAIL_BACKEND set to django.core.mail.backends.console.EmailBackend which will print out any email being sent rather than sending it to an SMTP server.

@russtoku
Copy link
Member

Another thing (off topic) is the TIME_ZONE setting. We should set it in uipa_org/settings/base.py to Pacific/Honolulu. Without that, it is set to Europe/Berlin.

Copy link
Member

@russtoku russtoku left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using the email configuration from Tyler, I was able to send a FOI request from my dev server instance to a test public body using my personal email address for the test public body. The email was sent via postmarkapp.com to my personal email address.

While I don't agree that the email configuration should be added to the Dev configuration, I approve this PR. I think that it is less confusing for contributors to not have to worry about sending email to an SMTP server. Any emails sent from a dev server will be printed on the console and not sent to an SMTP server. Also, we don't need to verify that emails can be sent by Django to an SMTP server.

@tyliec tyliec merged commit 59c4ffd into main Apr 29, 2024
@tyliec tyliec deleted the tyliec/email-settings branch April 29, 2024 21:10
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.

3 participants