add missing translation
[edumed.git] / wtem / management / commands / __init__.py
index e69de29..7fe1eba 100644 (file)
@@ -0,0 +1,18 @@
+from django.core.mail import EmailMessage
+from django.conf import settings
+
+
+def send_mail(subject, body, to):
+    if not isinstance(to, list):
+        to = [to]
+
+    reply_to = getattr(settings, 'WTEM_REPLY_TO', None)
+    headers = dict()
+    if reply_to:
+        headers['Reply-To'] = reply_to
+
+    email = EmailMessage(
+        subject, body,
+        getattr(settings, 'WTEM_FROM', 'olimpiada@nowoczesnapolska.org.pl'),
+        to, headers=headers)
+    email.send()