Sending mails.
authorMadhusudan.C.S <madhusudancs@gmail.com>
Fri, 07 Aug 2009 04:13:53 +0530
changeset 17 5c1e26fa0fc4
parent 16 bed14c9685a5
child 18 05b9e60e6a10
Sending mails.
app/projrev/views/login.py
app/settings.py
--- a/app/projrev/views/login.py	Fri Aug 07 03:56:08 2009 +0530
+++ b/app/projrev/views/login.py	Fri Aug 07 04:13:53 2009 +0530
@@ -55,6 +55,19 @@
       try:
         user = User.objects.create_user(username, username, password)
         user.save()
+        subject = "[Sakshath] Registration at Saskshath portal"
+        message = """Hi,
+            We have received a request for registration of your
+            email address, "%s", to the http://sakshath.ac.in mailing list.
+            \n\n
+            Your login credentials are:\n
+              username: %s\n
+              password: %s\n\n\n
+            Regards,
+              Saksath admin
+            """ % (username, username, password)
+
+        user.email_user(subject=subject, message=message)
         context = {
             'created': True,
             'username': username,
--- a/app/settings.py	Fri Aug 07 03:56:08 2009 +0530
+++ b/app/settings.py	Fri Aug 07 04:13:53 2009 +0530
@@ -9,6 +9,8 @@
     ('Madhusudan.C.S', 'madhusudancs@gmail.com'),
 )
 
+DEFAULT_FROM_EMAIL = 'admin@sakshath.ac.in'
+
 MANAGERS = ADMINS
 
 DATABASE_ENGINE = 'mysql'      # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.