From 4a7d32f5b7135e9a830c23df8a5504d1da3f6a09 Mon Sep 17 00:00:00 2001 From: lxf Date: Mon, 21 Dec 2020 12:19:24 -0500 Subject: moved lttr to actually send --- app/lttr/admin.py | 4 ++-- app/lttr/mailer.py | 4 ++-- app/lttr/models.py | 3 +++ 3 files changed, 7 insertions(+), 4 deletions(-) (limited to 'app') 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 ', 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, -- cgit v1.2.3-70-g09d2