FEATURE: send email to admins when a new user subscribe #41

This commit is contained in:
nobohan 2023-08-16 10:46:32 +02:00
parent d5a55aa4c3
commit 044a4c0a68
4 changed files with 21 additions and 9 deletions

View File

@ -127,7 +127,14 @@ or `npm run build:fr` for speeding up.
### Back-end development ### Back-end development
When developing the app and serving it with `docker-compose up`, the changes are automatically loaded (meaning, the app is watching the changes). However, it is more practical to change the command of the backend container from `command: bash start_gunicorn.sh` to `command: python wsgi.py` in order to have some logs. When developing the app and serving it with `docker-compose up`, the changes should be automatically loaded (meaning, the app is watching the changes) (Note that this is not the case anymore). However, it is more practical to change the command of the backend container from `command: bash start_gunicorn.sh` to `command: python wsgi.py` in order to have some logs.
You can access a flask shell terminal with the following:
```bash
docker-compose exec citizen-back bash
appuser@5d4fc6b169b2:~/citizen/backend$ flask shell
```
## Deploiement sur un serveur distant ## Deploiement sur un serveur distant

View File

@ -4,7 +4,7 @@ services:
db: db:
image: postgis/postgis:12-3.1-alpine image: postgis/postgis:12-3.1-alpine
ports: ports:
- "5432:5432" - "5434:5432"
volumes: volumes:
- "pg-data:/var/lib/postgresql/data" - "pg-data:/var/lib/postgresql/data"
environment: environment:

View File

@ -17,7 +17,7 @@ DEBUG = false
SQLALCHEMY_DEBUG_LEVEL = 'WARNING' SQLALCHEMY_DEBUG_LEVEL = 'WARNING'
# URL_APPLICATION = "http://mydomain.org" # Replace mydomain.org by your domain # URL_APPLICATION = "http://mydomain.org" # Replace mydomain.org by your domain
URL_APPLICATION = "http://taxhub:5000" URL_APPLICATION = "https://localhost:8080/"
API_TAXHUB = "http://taxhub:5000/api/" API_TAXHUB = "http://taxhub:5000/api/"
# API_TAXHUB = "http://mytaxhub.org/api/" # Replace mytaxhub.org by your TaxHub url # API_TAXHUB = "http://mytaxhub.org/api/" # Replace mytaxhub.org by your TaxHub url
@ -48,7 +48,7 @@ REWARDS_ENABLED = false
USE_CONFIRM_EMAIL = true USE_CONFIRM_EMAIL = true
SUBJECT = "Activez votre compte" SUBJECT = "Activez votre compte"
FROM = '"Biommap" <contact@geonature-citizen.fr>' FROM = '"Biommap" <contact@geonature-citizen.fr>'
HTML_TEMPLATE = '''<p> Bonjour,</p><br /><p>Nous vous confirmons que votre compte a bien été créé.</p> HTML_TEMPLATE = '''<p> Bonjour,</p><br /><p>Nous vous confirmons que votre compte Biommap a bien été créé.</p>
<p> Afin d'activer votre compte veuillez <a href="{activate_url}">cliquer ici.</a> <p> Afin d'activer votre compte veuillez <a href="{activate_url}">cliquer ici.</a>
<p>Nous vous souhaitons la bienvenue sur notre site.</p><br /> <p>Nous vous souhaitons la bienvenue sur notre site.</p><br />
<p>Bien à vous.</p> <p>Bien à vous.</p>
@ -61,10 +61,15 @@ REWARDS_ENABLED = false
[MAIL] [MAIL]
MAIL_USE_SSL = false MAIL_USE_SSL = false
MAIL_STARTTLS = true MAIL_STARTTLS = true
MAIL_HOST = 'smtpd host' MAIL_HOST = 'mail.easter-eggs.com'
MAIL_PORT = 493 # mandatory SSL port MAIL_PORT = 587 # mandatory SSL port
MAIL_AUTH_LOGIN = 'smtpd/relay host username' MAIL_AUTH_LOGIN = 'julien.minet@champs-libres.coop'
MAIL_AUTH_PASSWD = 'smtpd/relay host password' MAIL_AUTH_PASSWD = 'Bomel2164'
ADMIN_MESSAGE = '''<p>Bonjour administrateur,</p><br />
<p>Un nouvel utilisateur de Biommap avec le nom d'utilisateur "{newuser_username}" a été créé!</p>
<p>Vous pouvez gérer cet utilisateur dans l'espace d'administration.</p><br />
<p>Bonne journée</p>
'''
# API flasgger main config # API flasgger main config

@ -1 +1 @@
Subproject commit f9cb6faf966d7f4572f845e4f10fe1a88b95a7c0 Subproject commit ac2f8e8a1eb80ecbc902b59d897df9df95dae11e