Commit 34d46d27 authored by delanoe's avatar delanoe

[CONF]

- mail notification improved
- import url from settings
- message upated (links to gogs removed in the message, still present in
  the interface)
parent b160cc94
......@@ -26,6 +26,7 @@ SECRET_KEY = '!%ktkh981)piil1%t5r0g4$^0=uvdafk!=f2x8djxy7_gq(n5%'
DEBUG = True
MAINTENANCE = False
BASE_URL = "testing.gargantext.org"
ALLOWED_HOSTS = ["localhost", ".gargantext.org", ".iscpif.fr",]
......
......@@ -2,7 +2,7 @@
from gargantext.models.users import User
from gargantext.util.db import session
from django.core.mail import send_mail
from gargantext.settings import BASE_URL
def notify_owner(corpus):
user = session.query(User).filter(User.id == corpus.user_id).first()
......@@ -15,19 +15,19 @@ def notify_owner(corpus):
\"%s\"
à l'adresse:
http://dev.gargantext.org/projects/%d/corpora/%d
http://%s/projects/%d/corpora/%d
Nous restons à votre disposition pour tout complément d'information.
Cordialement
--
L'équipe de Gargantext (CNRS)
''' % (corpus.name, corpus.parent_id, corpus.id)
''' % (corpus.name, BASE_URL, corpus.parent_id, corpus.id)
if user.email != "" :
send_mail('[Gargantext] Votre analyse est terminée'
, message
, 'gargantua@dev.gargantext.org'
, 'team@gargantext.org'
, [user.email], fail_silently=False )
else:
print("User %s (%d), has no email" % (user.username, user.id) )
......
......@@ -28,6 +28,7 @@ django_models_names = set(model._meta.db_table for model in django_models)
from gargantext.util.db import session
from gargantext.models.users import User
from django.core.mail import send_mail
from gargantext.settings import BASE_URL
def make_random_password(length=10
, allowed_chars='abcdefghjkmnpqrstuvwxyz'
......@@ -45,32 +46,27 @@ def make_random_password(length=10
def notify_user(username, email, password):
message = '''
Bonjour,
votre compte vient d'être créé.
Vous pouvez désormais vous connecter ici:
http://%sgargantext.org
votre compte Gargantext vient d'être mis à jour.
Vous pouvez vous connecter à l'adresse:
http://%s
Avec les identifiants suivants:
Votre login est: %s
Votre mot de passe est : %s
La nouvelle version de Gargantext sort en septembre prochain.
La nouvelle version de Gargantext sort très prochainement.
Vous êtes actuellement sur la version de développement, vos retours
seront précieux pour stabiliser la plateforme: merci d'avance!
Foire aux questions de Gargantext:
https://gogs.iscpif.fr/humanities/faq_gargantext/wiki/FAQ
Rapporter un bogue:
https://gogs.iscpif.fr/humanities/faq_gargantext/issues
Nous restons à votre disposition pour tout complément d'information.
Cordialement
--
L'équipe de Gargantext (CNRS)
''' % ("dev.",username, password)
''' % (BASE_URL,username, password)
send_mail('[Gargantext] Votre accès à la plateforme', message, 'alexandre.delanoe@iscpif.fr', [email], fail_silently=False )
send_mail('[Gargantext] Votre accès à la plateforme', message, 'team@gargantext.org', [email], fail_silently=False )
# add option for mass sending email
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment