Skip to content

Commit

Permalink
Add support for Office365 e-mail backend (Amsterdam#1221)
Browse files Browse the repository at this point in the history
  • Loading branch information
bartjkdp authored May 2, 2023
1 parent 1d21509 commit 883bb91
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions app/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ django-cors-headers==3.13.0
django-extensions==3.2.0
django-filter==22.1
django-markdownx==3.0.1
django-o365mail==1.1.0
django-rest-swagger==2.2.0
django-silk==5.0.3
django-storages==1.12.3
Expand Down
3 changes: 3 additions & 0 deletions app/requirements/req-base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ flower
# Sentry
raven

# Office365 email backend
django-o365mail

#Azure insight
opencensus-ext-azure
opencensus-ext-django
Expand Down
13 changes: 13 additions & 0 deletions app/signals/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,19 @@ def is_super_user(user):
EMAIL_REST_ENDPOINT_CLIENT_KEY = os.getenv('EMAIL_REST_ENDPOINT_CLIENT_KEY', None)
EMAIL_REST_ENDPOINT_CA_BUNDLE = os.getenv('EMAIL_REST_ENDPOINT_CA_BUNDLE', None)

O365_ACTUALLY_SEND_IN_DEBUG = os.getenv('O365_ACTUALLY_SEND_IN_DEBUG', False) in TRUE_VALUES
O365_MAIL_CLIENT_ID = os.getenv('O365_MAIL_CLIENT_ID', None)
O365_MAIL_CLIENT_SECRET = os.getenv('O365_MAIL_CLIENT_SECRET', None)
O365_MAIL_TENANT_ID = os.getenv('O365_MAIL_TENANT_ID', None)
O365_MAIL_ACCOUNT_KWARGS = {
'token_backend': 'O365.utils.token.EnvTokenBackend'
}

if os.getenv('O365_MAIL_RESOURCE'):
O365_MAIL_MAILBOX_KWARGS = {
'resource': os.getenv('O365_MAIL_RESOURCE')
}

DEFAULT_FROM_EMAIL = os.getenv('DEFAULT_FROM_EMAIL', 'Meldingen gemeente Amsterdam <[email protected]>')
DEFAULT_AUTO_FIELD = 'django.db.models.AutoField'

Expand Down

0 comments on commit 883bb91

Please sign in to comment.