summaryrefslogtreecommitdiff
path: root/app/links/retriever.py
diff options
context:
space:
mode:
authorGitea <gitea@fake.local>2020-04-29 02:15:31 +0000
committerGitea <gitea@fake.local>2020-04-29 02:15:31 +0000
commitafe50e464d76690fc1fa7c6d72c0d6d7e743a527 (patch)
treeea2b277ddc3d9aaba2ffd3e92ebdcd5c5e6ce51f /app/links/retriever.py
parent9ce8f0ef97d06750c323785828620becf375058f (diff)
adding stuff from live server
Diffstat (limited to 'app/links/retriever.py')
-rw-r--r--app/links/retriever.py14
1 files changed, 9 insertions, 5 deletions
diff --git a/app/links/retriever.py b/app/links/retriever.py
index 8916f7c..8843557 100644
--- a/app/links/retriever.py
+++ b/app/links/retriever.py
@@ -5,6 +5,7 @@ from django.core.exceptions import ObjectDoesNotExist
from django.template.defaultfilters import striptags
from django.core.mail import EmailMessage
from django.conf import settings
+from django.core.mail import send_mail
from links.models import Link
@@ -49,12 +50,15 @@ def email_link(link):
"""
Sends an imported link to Gmail (never hurts to have backups)
"""
- subject = link.title
+ subject = "[link] %s" % link.title
body = "%s\n\n%s\n\n\nvisit site:%s\n" % (link.title, link.description, link.url)
- msg = EmailMessage(subject, striptags(body), 'sng@luxagraf.net', ['luxagraf+links@gmail.com'])
- msg.send()
- msg = EmailMessage(subject, striptags(body), 'sng@luxagraf.net', ['sng+links@luxagraf.net'])
- msg.send()
+ #msg = EmailMessage(subject, striptags(body), 'sng@luxagraf.net', ['sng@luxagraf.net'])
+ send_mail(
+ subject,
+ body,
+ 'sng@luxagraf.net',
+ ['sng@luxagraf.net']
+ )
def random_link():