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

feat: allow env-var based email config #2662

Closed

Conversation

revolunet
Copy link

Fixes Kinto/kinto-emailer#233

Hi, i'm not sure this is the way to fix it, but this allow to use environment variables to configure pyramid email settings

I can now use these variables without any ini file :

MAIL_DEFAULT_SENDER=toto@toto.com
MAIL_HOST=smtp.orange.fr
MAIL_PORT=25
  • Add documentation.
  • Add tests.
  • Add a changelog entry.
  • Add your name in the contributors file.
  • If you changed the HTTP API, update the API_VERSION constant and add an API changelog entry in the docs
  • If you added a new configuration setting, update the kinto.tpl file with it.

"mail.port": 25,
"mail.default_sender": None,
"mail.username": None,
"mail.password": None,
Copy link
Contributor

Choose a reason for hiding this comment

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

This is one way of solving it, but I think it would be better to introduce a sort of registry to be used by plugins.

kinto-emailer could register expected settings:

config.kinto_setting("mail.host", default="localhost")
config.kinto_setting("mail.port", cast=int, default=25)
config.kinto_setting("mail.password", env="PASSWD")

See #1544

Copy link
Author

Choose a reason for hiding this comment

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

i have no idea how to do this :) is there any plugin as example ?

Copy link
Contributor

Choose a reason for hiding this comment

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

I wrote some details here #1544 (comment)

Copy link
Contributor

Choose a reason for hiding this comment

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

Let's discuss there ;)

@leplatrem
Copy link
Contributor

Please reopen if you still would like to see this implemented :)

@leplatrem leplatrem closed this Apr 21, 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.

Pyramid email configuration via env variables
2 participants