From 4e1c6219d335df8c50cfa41fa287da5cfb8e6900 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bodor=20M=C3=A1t=C3=A9?= <bodor.mate@kszk.bme.hu>
Date: Thu, 17 Jan 2019 21:50:35 +0100
Subject: [PATCH] Add email

---
 src/account/auth_pipeline.py   | 2 ++
 src/kszkepzes/settings/base.py | 4 ++++
 2 files changed, 6 insertions(+)

diff --git a/src/account/auth_pipeline.py b/src/account/auth_pipeline.py
index 1e9d01f..2c6c425 100644
--- a/src/account/auth_pipeline.py
+++ b/src/account/auth_pipeline.py
@@ -1,5 +1,6 @@
 from django.core import exceptions
 from django.http import HttpResponseServerError
+from django.core.mail import send_mail
 
 from . import models
 
@@ -10,3 +11,4 @@ def create_profile(backend, user, response, *args, **kwargs):
             user.profile
         except exceptions.ObjectDoesNotExist:
             models.Profile.objects.create(user=user)
+            send_mail('TESZT', 'Attiss meleg!4!!', 'noreply@keszkepzes.sch.bme.hu', user.email)
diff --git a/src/kszkepzes/settings/base.py b/src/kszkepzes/settings/base.py
index 81c4c31..305d41c 100644
--- a/src/kszkepzes/settings/base.py
+++ b/src/kszkepzes/settings/base.py
@@ -158,3 +158,7 @@ STATIC_URL = '/django-static/'
 
 MEDIA_ROOT = os.getenv('MEDIA_ROOT', '/tmp')
 MEDIA_URL = '/media/'
+
+EMAIL_HOST = 'mail.sch.bme.hu'
+EMAIL_PORT = 587
+EMAIL_USE_TLS = True
-- 
GitLab