Updating premium archive email.

This commit is contained in:
Samuel Clay 2022-03-17 16:54:40 -04:00
parent 39e68e4744
commit 38d2341a6c
5 changed files with 29 additions and 59 deletions

View file

@ -148,7 +148,7 @@ class EmailNewsletter:
from_email='NewsBlur <%s>' % settings.HELLO_EMAIL,
to=['%s <%s>' % (user, user.email)])
msg.attach_alternative(html, "text/html")
msg.send(fail_silently=True)
msg.send()
logging.user(user, "~BB~FM~SBSending first newsletter email to: %s" % user.email)

View file

@ -1088,7 +1088,7 @@ class Profile(models.Model):
from_email='NewsBlur <%s>' % settings.HELLO_EMAIL,
to=['%s <%s>' % (user, user.email)])
msg.attach_alternative(html, "text/html")
msg.send(fail_silently=True)
msg.send()
logging.user(self.user, "~BB~FM~SBSending email for new user: %s" % self.user.email)
@ -1123,7 +1123,7 @@ class Profile(models.Model):
to=['%s <%s>' % (user, user.email)])
msg.attach_alternative(html, "text/html")
msg.attach(filename, opml, 'text/xml')
msg.send(fail_silently=True)
msg.send()
from apps.social.models import MActivity
MActivity.new_opml_export(user_id=self.user.pk, count=exporter.feed_count, automated=True)
@ -1159,21 +1159,11 @@ class Profile(models.Model):
from_email='NewsBlur <%s>' % settings.HELLO_EMAIL,
to=['%s <%s>' % (user, user.email)])
msg.attach_alternative(html, "text/html")
msg.send(fail_silently=True)
msg.send()
logging.user(self.user, "~BB~FM~SBSending first share to blurblog email to: %s" % self.user.email)
def send_new_premium_email(self, force=False):
# subs = UserSubscription.objects.filter(user=self.user)
# message = """Woohoo!
#
# User: %(user)s
# Feeds: %(feeds)s
#
# Sincerely,
# NewsBlur""" % {'user': self.user.username, 'feeds': subs.count()}
# mail_admins('New premium account', message, fail_silently=True)
def send_new_premium_email(self, force=False):
if not self.user.email or not self.send_emails:
return
@ -1189,26 +1179,16 @@ class Profile(models.Model):
user = self.user
text = render_to_string('mail/email_new_premium.txt', locals())
html = render_to_string('mail/email_new_premium.xhtml', locals())
subject = "Thanks for going premium on NewsBlur!"
subject = "Thank you for subscribing to NewsBlur Premium!"
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)
msg.send()
logging.user(self.user, "~BB~FM~SBSending email for new premium: %s" % self.user.email)
def send_new_premium_archive_email(self, force=False):
# subs = UserSubscription.objects.filter(user=self.user)
# message = """Woohoo!
#
# User: %(user)s
# Feeds: %(feeds)s
#
# Sincerely,
# NewsBlur""" % {'user': self.user.username, 'feeds': subs.count()}
# mail_admins('New premium account', message, fail_silently=True)
if not self.user.email or not self.send_emails:
return
@ -1224,26 +1204,16 @@ class Profile(models.Model):
user = self.user
text = render_to_string('mail/email_new_premium_archive.txt', locals())
html = render_to_string('mail/email_new_premium_archive.xhtml', locals())
subject = "Thanks for subscribing to NewsBlur Premium Archive!"
subject = "Thank you for subscribing to NewsBlur Premium Archive!"
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)
msg.send()
logging.user(self.user, "~BB~FM~SBSending email for new premium archive: %s" % self.user.email)
def send_new_premium_pro_email(self, force=False):
# subs = UserSubscription.objects.filter(user=self.user)
# message = """Woohoo!
#
# User: %(user)s
# Feeds: %(feeds)s
#
# Sincerely,
# NewsBlur""" % {'user': self.user.username, 'feeds': subs.count()}
# mail_admins('New premium account', message, fail_silently=True)
if not self.user.email or not self.send_emails:
return
@ -1264,7 +1234,7 @@ class Profile(models.Model):
from_email='NewsBlur <%s>' % settings.HELLO_EMAIL,
to=['%s <%s>' % (user, user.email)])
msg.attach_alternative(html, "text/html")
msg.send(fail_silently=True)
msg.send()
logging.user(self.user, "~BB~FM~SBSending email for new premium pro: %s" % self.user.email)
@ -1285,7 +1255,7 @@ class Profile(models.Model):
from_email='NewsBlur <%s>' % settings.HELLO_EMAIL,
to=['%s <%s>' % (user, user.email)])
msg.attach_alternative(html, "text/html")
msg.send(fail_silently=True)
msg.send()
logging.user(self.user, "~BB~FM~SBSending email for forgotten password: %s" % self.user.email)
@ -1311,7 +1281,7 @@ class Profile(models.Model):
from_email='NewsBlur <%s>' % settings.HELLO_EMAIL,
to=['%s <%s>' % (user, user.email)])
msg.attach_alternative(html, "text/html")
msg.send(fail_silently=True)
msg.send()
logging.user(self.user, "~BB~FM~SBSending email for new user queue: %s" % self.user.email)
@ -1392,7 +1362,7 @@ class Profile(models.Model):
from_email='NewsBlur <%s>' % settings.HELLO_EMAIL,
to=['%s <%s>' % (user, user.email)])
msg.attach_alternative(html, "text/html")
msg.send(fail_silently=True)
msg.send()
logging.user(self.user, "~BB~FM~SBSending launch social email for user: %s months, %s" % (months_ago, self.user.email))
@ -1422,7 +1392,7 @@ class Profile(models.Model):
from_email='NewsBlur <%s>' % settings.HELLO_EMAIL,
to=['%s <%s>' % (user, user.email)])
msg.attach_alternative(html, "text/html")
msg.send(fail_silently=True)
msg.send()
logging.user(self.user, "~BB~FM~SBSending launch TT email for user: %s months, %s" % (months_ago, self.user.email))
@ -1452,7 +1422,7 @@ class Profile(models.Model):
from_email='NewsBlur <%s>' % settings.HELLO_EMAIL,
to=['%s <%s>' % (user, user.email)])
msg.attach_alternative(html, "text/html")
msg.send(fail_silently=True)
msg.send()
logging.user(self.user, "~BB~FM~SBSending launch TT end email for user: %s months, %s" % (months_ago, self.user.email))
@ -1488,7 +1458,7 @@ class Profile(models.Model):
from_email='NewsBlur <%s>' % settings.HELLO_EMAIL,
to=['%s <%s>' % (user, user.email)])
msg.attach_alternative(html, "text/html")
msg.send(fail_silently=True)
msg.send()
MSentEmail.record(receiver_user_id=self.user.pk, email_type='premium_expire_grace')
logging.user(self.user, "~BB~FM~SBSending premium expire grace email for user: %s months, %s" % (months_ago, self.user.email))
@ -1517,7 +1487,7 @@ class Profile(models.Model):
from_email='NewsBlur <%s>' % settings.HELLO_EMAIL,
to=['%s <%s>' % (user, user.email)])
msg.attach_alternative(html, "text/html")
msg.send(fail_silently=True)
msg.send()
MSentEmail.record(receiver_user_id=self.user.pk, email_type='premium_expire')
logging.user(self.user, "~BB~FM~SBSending premium expire email for user: %s months, %s" % (months_ago, self.user.email))

View file

@ -340,7 +340,7 @@ def profile_is_premium(request):
if not request.user.profile.is_premium:
subject = "Premium activation failed: %s (%s/%s)" % (request.user, activated_subs, total_subs)
message = """User: %s (%s) -- Email: %s""" % (request.user.username, request.user.pk, request.user.email)
mail_admins(subject, message, fail_silently=True)
mail_admins(subject, message)
request.user.profile.is_premium = True
request.user.profile.save()
@ -365,7 +365,7 @@ def save_ios_receipt(request):
logging.user(request, "~BM~FBSending iOS Receipt email: %s %s" % (product_identifier, transaction_identifier))
subject = "iOS Premium: %s (%s)" % (request.user.profile, product_identifier)
message = """User: %s (%s) -- Email: %s, product: %s, txn: %s, receipt: %s""" % (request.user.username, request.user.pk, request.user.email, product_identifier, transaction_identifier, receipt)
mail_admins(subject, message, fail_silently=True)
mail_admins(subject, message)
else:
logging.user(request, "~BM~FBNot sending iOS Receipt email, already paid: %s %s" % (product_identifier, transaction_identifier))
@ -385,7 +385,7 @@ def save_android_receipt(request):
logging.user(request, "~BM~FBSending Android Receipt email: %s %s" % (product_id, order_id))
subject = "Android Premium: %s (%s)" % (request.user.profile, product_id)
message = """User: %s (%s) -- Email: %s, product: %s, order: %s""" % (request.user.username, request.user.pk, request.user.email, product_id, order_id)
mail_admins(subject, message, fail_silently=True)
mail_admins(subject, message)
else:
logging.user(request, "~BM~FBNot sending Android Receipt email, already paid: %s %s" % (product_id, order_id))

View file

@ -2,10 +2,10 @@
{% block body %}Thank you, thank you, thank you!
A *huge* thanks for going premium.
A *huge* thanks for subscribing to the premium archive tier!
Your subscription goes a long way towards funding the further development of NewsBlur.
Your subscription helps pay for the machines which store and process your archive.
There's still a ton of great work to be done, and you are personally keeping the dream alive. Thanks again, paying users like you make this entire endeavor worthwhile.
NewsBlur is an archive for the web you follow. Search it, clip highlights and share notes, and rest assured that your data will remain even as the web it pulls from may not. Thanks again for supporting NewsBlur.
- Sam Clay{% endblock body %}
- Sam Clay{% endblock body %}

View file

@ -1,12 +1,12 @@
{% extends "mail/email_base.xhtml" %}
{% block body %}
<h2 style="color: #282F33; font-size: 18px; font-weight: bold;">Thank you, thank you, thank you!</h2>
<h2 style="color: #282F33; font-size: 18px; font-weight: bold;">Now everything you read on the web is archived</h2>
<p style="line-height: 20px;">A <b>huge</b> thanks for going premium.</p>
<p style="line-height: 20px;">Your subscription goes a long way towards funding the further development of NewsBlur.</p>
<p style="line-height: 20px;">There's still a ton of great work to be done, and you are personally keeping the dream alive. Thanks again, paying users like you make this entire endeavor worthwhile.</p>
<p style="line-height: 20px;">A <b>huge</b> thanks for subscribing to the premium archive tier.</p>
<p style="line-height: 20px;">Your subscription helps pay for the machines which store and process your archive.</p>
<p style="line-height: 20px;">NewsBlur is an archive for the web you follow. Search it, clip highlights and share notes, and rest assured that your data will remain even as the web it pulls from may not. Thanks again for supporting NewsBlur.</p>
<p style="line-height: 20px;">- Sam Clay</p>
{% endblock %}
{% block resources_header %}Now that you're premium, you may want to follow a few resources:{% endblock resources_header %}
{% block resources_header %}As always, you have access to a number of resources:{% endblock resources_header %}