diff options
Diffstat (limited to 'app/links/retriever.py')
-rw-r--r-- | app/links/retriever.py | 14 |
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(): |