summaryrefslogtreecommitdiff
path: root/app/lttr/mailer.py
diff options
context:
space:
mode:
authorluxagraf <sng@luxagraf>2021-03-05 09:14:04 -0500
committerluxagraf <sng@luxagraf>2021-03-05 09:14:04 -0500
commit12e78738d5d3a4fda2db33649c0db57bd3be1d77 (patch)
tree70bf4ccc0e1da3c472922935de06e4144834c00d /app/lttr/mailer.py
parentb9ea327656740c53215eba6d599c2801bf706ce8 (diff)
lttr: added templates to send emails to range test
Diffstat (limited to 'app/lttr/mailer.py')
-rw-r--r--app/lttr/mailer.py17
1 files changed, 6 insertions, 11 deletions
diff --git a/app/lttr/mailer.py b/app/lttr/mailer.py
index 7a3ce3f..9ddcfa0 100644
--- a/app/lttr/mailer.py
+++ b/app/lttr/mailer.py
@@ -36,16 +36,10 @@ class SendShit():
)
# New instance, try sending
if created:
- try:
- email = self.build_message(subscriber)
- status.status=1
- if self.verbose==1:
- print("successfully sent %s the newsletter mailing %s"%(subscriber, self.mailing))
- except:
- status.status=2
- if self.verbose == 1:
- print("failed to send %s to %s"%(self.mailing, subscriber))
- status.save()
+ email = self.build_message(subscriber)
+ status.status=1
+ if self.verbose==1:
+ print("successfully sent %s the newsletter mailing %s"%(subscriber, self.mailing))
else:
# not new, check if error and resend or just continue
if status.status == 2:
@@ -74,9 +68,10 @@ class SendShit():
from_email, to = 'Scott Gilbertson <sng@luxagraf.net>', subscriber.get_email()
text_content = render_to_string(self.newsletter.get_template_plain(), {'object': self.mailing, 'subscriber':subscriber})
html_content = render_to_string(self.newsletter.get_template_html(), {'object': self.mailing, 'subscriber':subscriber})
- #print(text_content)
+ #print(html_content)
msg = EmailMultiAlternatives(subject, text_content, from_email, [to])
msg.attach_alternative(html_content, "text/html")
+ #msg.Header.Add('List-Unsubscribe', '<https://luxagraf.net%s>' % subscriber.unsubscribe_activate_url)
msg.send()
'''