diff src/plugins/plugin_misc_account.py @ 1433:5d42e2219d7c

plugin misc_account: change the message sent by email after an account creation
author souliane <souliane@mailoo.org>
date Sat, 06 Jun 2015 17:01:22 +0200
parents 3265a2639182
children 200efadcab76
line wrap: on
line diff
--- a/src/plugins/plugin_misc_account.py	Wed May 27 19:12:38 2015 +0200
+++ b/src/plugins/plugin_misc_account.py	Sat Jun 06 17:01:22 2015 +0200
@@ -203,50 +203,53 @@
         return d
 
     def _sendEmails(self, result, login, email, password):
-        #time to send the email
+        # time to send the email
 
         _email_host = self.getConfig('email_server')
         _email_from = self.getConfig("email_from")
+        domain = self.getConfig('new_account_domain')
 
         def email_ok(ignore):
-            print ("Account creation email sent to %s" % email)
+            log.debug(u"Account creation email sent to %s" % email)
 
         def email_ko(ignore):
-            #TODO: return error code to user
+            # TODO: return error code to user
             log.error(u"Failed to send email to %s" % email)
 
-        body = (u"""Welcome to Libervia, a Salut à Toi project part
+        body = (_(u"""Welcome to Libervia, the web interface of Salut à Toi.
 
-/!\\ WARNING, THIS IS ONLY A TECHNICAL DEMO, DON'T USE THIS ACCOUNT FOR ANY SERIOUS PURPOSE /!\\
+Your account on %(domain)s has been successfully created. This is a demonstration version to show you the current status of the project. It is still under development, it misses some features and it's not stable enough to be used for any serious purpose. Please keep it in mind!
 
 Here is your connection information:
----
-login: %(login)s
+
+Login on libervia.org: %(login)s
+Jabber ID (JID): %(login)s@%(domain)s
 
-Your Jabber ID (JID) is: %(jid)s
----
+Your password has been chosen by yourself. If you haven't read our security notice regarding the connection to https://libervia.org, please do it now:
 
-To try with some contacts, you can use the directory: subscribe in your parameters, and use it with the Communication/Search directory menu.
+http://salut-a-toi.org/faq.html#certificate
 
-SàT website: http://www.salut-a-toi.org
-follow SàT news: http://www.goffi.org
+In the beginning, you have nobody to talk to. To find some contacts, use the users' directory:
+    - make yourself visible in "Settings" / "Parameters" / "Directory".
+    - search for people with "Communication" / "Search directory".
 
-Any feedback welcome
+Any feedback welcome. Thank you!
 
-Cheers
-SàT team""" % {'login': login, 'jid': "%s@%s" % (login, self.getConfig('new_account_domain'))}).encode('utf-8')
+Salut à Toi association
+http://www.salut-a-toi.org
+""") % {'login': login, 'domain': domain}).encode('utf-8')
         msg = MIMEText(body, 'plain', 'UTF-8')
-        msg['Subject'] = 'Libervia account created'
+        msg['Subject'] = _(u'Libervia account created')
         msg['From'] = _email_from
         msg['To'] = email
 
         d_user = sendmail(_email_host, _email_from, email, msg.as_string())
         d_user.addCallbacks(email_ok, email_ko)
 
-        #email to the administrator
+        # email to the administrator
         body = (u"""New account created: %(login)s [%(email)s]""" % {'login': login, 'email': email}).encode('utf-8')
         msg = MIMEText(body, 'plain', 'UTF-8')
-        msg['Subject'] = 'Libervia new account created'
+        msg['Subject'] = _('New Libervia account created')
         msg['From'] = _email_from
         msg['To'] = self.getConfig('admin_email')