summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorluxagraf <sng@luxagraf.net>2020-11-12 10:39:33 -0500
committerluxagraf <sng@luxagraf.net>2020-11-12 10:39:33 -0500
commita551326ec05f761f58a0ba68b4ca8af95d9e652d (patch)
tree3c449c61432606a8d41d04b4499739db8fb7b780 /app
parent74b2bb76ca3be85092a978ee60d26340c7e789a8 (diff)
rearranged email templates, added footer to plain text email.
Diffstat (limited to 'app')
-rw-r--r--app/lttr/mailer.py7
-rw-r--r--app/lttr/models.py1
-rw-r--r--app/lttr/templates/lttr/emails/friends_base_left.html (renamed from app/lttr/templates/lttr/friends_base_left.html)0
-rw-r--r--app/lttr/templates/lttr/emails/friends_html_email.html (renamed from app/lttr/templates/lttr/friends_base.html)0
-rw-r--r--app/lttr/templates/lttr/emails/friends_plain_text_email.txt16
5 files changed, 20 insertions, 4 deletions
diff --git a/app/lttr/mailer.py b/app/lttr/mailer.py
index b5b875e..9972ea2 100644
--- a/app/lttr/mailer.py
+++ b/app/lttr/mailer.py
@@ -72,11 +72,12 @@ class SendShit():
"""
subject = smart_str("%s: %s — %s" %(self.mailing.newsletter.title, self.mailing.get_issue_str(), self.mailing.title))
from_email, to = 'Scott Gilbertson <sng@luxagraf.net>', subscriber.get_email()
- text_content = self.mailing.email_encode()
- html_content = render_to_string('lttr/friends_base.html', {'object': self.mailing, 'subscriber':subscriber})
+ 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)
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 51f620c..f702478 100644
--- a/app/lttr/models.py
+++ b/app/lttr/models.py
@@ -157,7 +157,6 @@ class NewsletterMailing(models.Model):
return issue
def email_encode(self):
-
return self.body_markdown
@property
diff --git a/app/lttr/templates/lttr/friends_base_left.html b/app/lttr/templates/lttr/emails/friends_base_left.html
index f2b91e6..f2b91e6 100644
--- a/app/lttr/templates/lttr/friends_base_left.html
+++ b/app/lttr/templates/lttr/emails/friends_base_left.html
diff --git a/app/lttr/templates/lttr/friends_base.html b/app/lttr/templates/lttr/emails/friends_html_email.html
index 42e7795..42e7795 100644
--- a/app/lttr/templates/lttr/friends_base.html
+++ b/app/lttr/templates/lttr/emails/friends_html_email.html
diff --git a/app/lttr/templates/lttr/emails/friends_plain_text_email.txt b/app/lttr/templates/lttr/emails/friends_plain_text_email.txt
new file mode 100644
index 0000000..729d83a
--- /dev/null
+++ b/app/lttr/templates/lttr/emails/friends_plain_text_email.txt
@@ -0,0 +1,16 @@
+
+{{ object.email_encode }}
+
+-----
+
+You're getting this email because you signed up for
+
+Scott Gilbertson's (luxagraf)[https://luxagraf.net/] newsletter,
+
+*Friends of a Long Year* [https://luxagraf.net/newsletter/friends/]
+
+If you're new, you can explore past letters here: [https://luxagraf.net/newsletter/friends/]
+
+You can always: Unsubscribe [https://luxagraf.net{{subscriber.unsubscribe_activate_url}}] instantly.
+
+[https://luxagraf.net/] ✪ [https://luxagraf.net/newsletter/friends/]