summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorlxf <sng@luxagraf.net>2020-12-21 12:19:24 -0500
committerlxf <sng@luxagraf.net>2020-12-21 12:19:24 -0500
commit4a7d32f5b7135e9a830c23df8a5504d1da3f6a09 (patch)
tree23be8ca3b27f5891ee04c57abd520710cf1be92f /app
parentd01b0b99b417d2c3ed0d218e2d7b23e2595f18d0 (diff)
moved lttr to actually send
Diffstat (limited to 'app')
-rw-r--r--app/lttr/admin.py4
-rw-r--r--app/lttr/mailer.py4
-rw-r--r--app/lttr/models.py3
3 files changed, 7 insertions, 4 deletions
diff --git a/app/lttr/admin.py b/app/lttr/admin.py
index d7d68bc..b406613 100644
--- a/app/lttr/admin.py
+++ b/app/lttr/admin.py
@@ -50,5 +50,5 @@ class NewsletterMailingAdmin(admin.ModelAdmin):
@admin.register(MailingStatus)
class MailingStatusAdmin(admin.ModelAdmin):
- list_display = ('newsletter_mailing', 'subscriber', 'status', 'creation_date')
- list_filter = ('status', 'creation_date')
+ list_display = ('newsletter_mailing', 'subscriber', 'status', 'creation_date', 'newsletter')
+ list_filter = ('status', 'creation_date', 'newsletter_mailing__newsletter')
diff --git a/app/lttr/mailer.py b/app/lttr/mailer.py
index 9972ea2..143fbf2 100644
--- a/app/lttr/mailer.py
+++ b/app/lttr/mailer.py
@@ -74,10 +74,10 @@ class SendShit():
from_email, to = 'Scott Gilbertson <sng@luxagraf.net>', subscriber.get_email()
text_content = render_to_string('lttr/emails/friends_plain_text_email.txt', {'object': self.mailing, 'subscriber':subscriber})
html_content = render_to_string('lttr/emails/friends_html_email.html', {'object': self.mailing, 'subscriber':subscriber})
- print(text_content)
+ #print(text_content)
msg = EmailMultiAlternatives(subject, text_content, from_email, [to])
msg.attach_alternative(html_content, "text/html")
- #msg.send()
+ msg.send()
'''
for header, value in self.newsletter.server.custom_headers.items():
diff --git a/app/lttr/models.py b/app/lttr/models.py
index bce6b06..8c0f335 100644
--- a/app/lttr/models.py
+++ b/app/lttr/models.py
@@ -390,6 +390,9 @@ class MailingStatus(models.Model):
status = models.IntegerField(choices=StatusType.choices, null=True)
creation_date = models.DateTimeField(_('creation date'), auto_now_add=True)
+ def newsletter(self):
+ return newsletter_mailing.newsletter
+
def __str__(self):
return '%s : %s : %s' % (self.newsletter_mailing,
self.subscriber,