From 5d6ad89bf6f5d5c531c296897b0283272e2afc9d Mon Sep 17 00:00:00 2001 From: Samuel Clay Date: Wed, 8 Mar 2017 18:04:57 -0800 Subject: [PATCH] Adding template for Turn Touch end campaign email. --- apps/profile/models.py | 30 +++++++++++++++++++ templates/mail/email_launch_turntouch_end.txt | 17 +++++++++++ .../mail/email_launch_turntouch_end.xhtml | 25 ++++++++++++++++ 3 files changed, 72 insertions(+) create mode 100644 templates/mail/email_launch_turntouch_end.txt create mode 100644 templates/mail/email_launch_turntouch_end.xhtml diff --git a/apps/profile/models.py b/apps/profile/models.py index e50e52bd5..d03ed3d90 100644 --- a/apps/profile/models.py +++ b/apps/profile/models.py @@ -813,6 +813,36 @@ NewsBlur""" % {'user': self.user.username, 'feeds': subs.count()} msg.send(fail_silently=True) logging.user(self.user, "~BB~FM~SBSending launch TT email for user: %s months, %s" % (months_ago, self.user.email)) + + def send_launch_turntouch_end_email(self, force=False): + if not self.user.email or not self.send_emails: + logging.user(self.user, "~FM~SB~FRNot~FM sending launch TT end email for user, %s: %s" % (self.user.email and 'opt-out: ' or 'blank', self.user.email)) + return + + params = dict(receiver_user_id=self.user.pk, email_type='launch_turntouch_end') + try: + sent_email = MSentEmail.objects.get(**params) + if not force: + # Return if email already sent + logging.user(self.user, "~FM~SB~FRNot~FM sending launch TT end email for user, sent already: %s" % self.user.email) + return + except MSentEmail.DoesNotExist: + sent_email = MSentEmail.objects.create(**params) + + delta = datetime.datetime.now() - self.last_seen_on + months_ago = delta.days / 30 + user = self.user + data = dict(user=user, months_ago=months_ago) + text = render_to_string('mail/email_launch_turntouch_end.txt', data) + html = render_to_string('mail/email_launch_turntouch_end.xhtml', data) + subject = "Last day to back Turn Touch: NewsBlur's beautiful remote" + msg = EmailMultiAlternatives(subject, text, + from_email='NewsBlur <%s>' % settings.HELLO_EMAIL, + to=['%s <%s>' % (user, user.email)]) + msg.attach_alternative(html, "text/html") + msg.send(fail_silently=True) + + logging.user(self.user, "~BB~FM~SBSending launch TT end email for user: %s months, %s" % (months_ago, self.user.email)) def grace_period_email_sent(self, force=False): emails_sent = MSentEmail.objects.filter(receiver_user_id=self.user.pk, diff --git a/templates/mail/email_launch_turntouch_end.txt b/templates/mail/email_launch_turntouch_end.txt new file mode 100644 index 000000000..aee9406b2 --- /dev/null +++ b/templates/mail/email_launch_turntouch_end.txt @@ -0,0 +1,17 @@ +{% extends "mail/email_base.txt" %} + +{% load utils_tags %} + +{% block body %}This is it, the final countdown! + +Tonight at 8pm PT the Turn Touch campaign will end and the project will be successfully funded. Judging from the $50,000 raised already, I think Turn Touch has a long life ahead of it. + +Watch the 2 minute demo on Vimeo: https://vimeo.com/207556527 + +Apart from being the only remote control in the world built for a news reader, Turn Touch is the handiest shortcut for your lights, music, and apps. It's basically a customizable remote with a knack for smart homes. + +Supporting Turn Touch is a way of supporting NewsBlur. They are part of the same suite of productivity tools made by the same person (@samuelclay: https://twitter.com/samuelclay). By buying a Turn Touch and backing this Kickstarter, you're continuing to fund the development of great tools. + +So please head to Kickstarter and buy yourself the $59 mahogany remote, even if you do not yet have any smart home devices. This remote is the easiest way to start connecting your home. + +https://turntouch.com/kickstarter{% endblock body %} \ No newline at end of file diff --git a/templates/mail/email_launch_turntouch_end.xhtml b/templates/mail/email_launch_turntouch_end.xhtml new file mode 100644 index 000000000..8dada4a36 --- /dev/null +++ b/templates/mail/email_launch_turntouch_end.xhtml @@ -0,0 +1,25 @@ +{% extends "mail/email_base.xhtml" %} +{% load utils_tags %} + +{% block body %} +

This is it, the final countdown!

+ +

Tonight at 8pm PT the Turn Touch campaign will end and the project will be successfully funded. Judging from the $50,000 raised already, I think Turn Touch has a long life ahead of it.

+ +

+ +
🖥 Watch the 2 minute demo on Vimeo
+ +

Apart from being the only remote control in the world built for a news reader, Turn Touch is the handiest shortcut for your lights, music, and apps. It's basically a customizable remote with a knack for smart homes.

+ +

Supporting Turn Touch is a way of supporting NewsBlur. They are part of the same suite of productivity tools made by the same person. By buying a Turn Touch and backing this Kickstarter, you're continuing to fund the development of great tools.

+ +

So please head to Kickstarter and buy yourself the $59 mahogany remote, even if you do not yet have any smart home devices. This remote is the easiest way to start connecting your home.

+ +

+ +

+ +

— @samuelclay

+ +{% endblock %} \ No newline at end of file