Fixed up account_expiring text...next step is to fix up account_expired and account_active

pull/1/head
Raymond Yee 2013-04-17 15:43:44 -07:00
parent 3b900e2328
commit aac69cf64c
8 changed files with 127 additions and 55 deletions

View File

@ -107,9 +107,23 @@ def notify_expiring_accounts():
from regluit.payment.models import Account
from django.contrib.sites.models import Site
expiring_accounts = Account.objects.filter('EXPIRING')
expiring_accounts = Account.objects.filter(status='EXPIRING')
for account in expiring_accounts:
notification.send_now([account.user], "account_expiring", {
'user': account.user,
'site':Site.objects.get_current()
}, True)
# used for bootstrapping our expired cc notification for first time
@task
def notify_expired_accounts():
from regluit.payment.models import Account
from django.contrib.sites.models import Site
expired_accounts = Account.objects.filter(status='EXPIRED')
for account in expired_accounts:
notification.send_now([account.user], "account_expired", {
'user': account.user,
'site':Site.objects.get_current()
}, True)

View File

@ -119,7 +119,26 @@
]
}
],
"prompt_number": 5
"prompt_number": 3
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"Account.objects.filter(status='EXPIRED')"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "pyout",
"prompt_number": 6,
"text": [
"[<Account: Account object>, <Account: Account object>, <Account: Account object>, <Account: Account object>, <Account: Account object>, <Account: Account object>]"
]
}
],
"prompt_number": 6
},
{
"cell_type": "heading",
@ -129,6 +148,59 @@
"coming up with good notices to send out "
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"from notification.engine import send_all\n",
"from notification import models as notification\n",
"\n",
"from django.contrib.sites.models import Site"
],
"language": "python",
"metadata": {},
"outputs": [],
"prompt_number": 19
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"from django.contrib.auth.models import User\n",
"ry = User.objects.get(email = 'raymond.yee@gmail.com')"
],
"language": "python",
"metadata": {},
"outputs": [],
"prompt_number": 20
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"notification.send_now([ry], \"account_expiring\", {\n",
" 'user': ry, \n",
" 'site':Site.objects.get_current()\n",
" }, True)"
],
"language": "python",
"metadata": {},
"outputs": [],
"prompt_number": 21
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"notification.send_now([ry], \"account_expired\", {\n",
" 'user': ry, \n",
" 'site':Site.objects.get_current()\n",
" }, True)"
],
"language": "python",
"metadata": {},
"outputs": []
},
{
"cell_type": "heading",
"level": 1,

View File

@ -6,11 +6,11 @@ As you requested, we
If you have any questions, we are happy to help. Simply email us at support@gluejar.com.
{% if request.user.profile.account %}
{% if user.profile.account %}
The current card we have on file:
Card type: {{ request.user.profile.account.card_type }}
Number: ************{{ request.user.profile.account.card_last4 }}
Expiration date: {{ request.user.profile.account.card_exp_month }}/{{ request.user.profile.account.card_exp_year }}.
Card type: {{ user.profile.account.card_type }}
Number: ************{{ user.profile.account.card_last4 }}
Expiration date: {{ user.profile.account.card_exp_month }}/{{ user.profile.account.card_exp_year }}.
We use Stripe< to keep your information secure.
{% endif %}

View File

@ -10,11 +10,11 @@
<p>If you have any questions, we are happy to help. Simply email us at
<a href="mailto:support@gluejar.com">support@gluejar.com</a>.</p>
{% if request.user.profile.account %}
{% if user.profile.account %}
<p>The current card we have on file:</p>
<b>Card type:</b> {{ request.user.profile.account.card_type }}<br />
<b>Number:</b> ************{{ request.user.profile.account.card_last4 }}<br />
<b>Expiration date:</b> {{ request.user.profile.account.card_exp_month }}/{{ request.user.profile.account.card_exp_year }}.<br />
<b>Card type:</b> {{ user.profile.account.card_type }}<br />
<b>Number:</b> ************{{ user.profile.account.card_last4 }}<br />
<b>Expiration date:</b> {{ user.profile.account.card_exp_month }}/{{ user.profile.account.card_exp_year }}.<br />
<p>We use <a href="https://stripe.com/">Stripe</a> to keep your information secure.</p><br />
{% endif %}

View File

@ -2,18 +2,18 @@
Your credit card has expired
We want to let you know that your {{ request.user.profile.account.card_type }} card ending
in {{ request.user.profile.account.card_last4 }} has expired.
We want to let you know that your {{ user.profile.account.card_type }} card ending
in {{ user.profile.account.card_last4 }} has expired.
When you receive your new card, simply go to https://{{ site.domain }}{% url manage_account %}
to enter your card information. Thank you!
If you have any questions, we are happy to help. Simply email us at support@gluejar.com.
{% if request.user.profile.account %}
{% if user.profile.account %}
The current card we have on file:
Card type: {{ request.user.profile.account.card_type }}
Number: ************{{ request.user.profile.account.card_last4 }}
Expiration date: {{ request.user.profile.account.card_exp_month }}/{{ request.user.profile.account.card_exp_year }}.
Card type: {{ user.profile.account.card_type }}
Number: ************{{ user.profile.account.card_last4 }}
Expiration date: {{ user.profile.account.card_exp_month }}/{{ user.profile.account.card_exp_year }}.
We use Stripe< to keep your information secure.
{% endif %}

View File

@ -5,19 +5,19 @@
<p>Your credit card has expired</p>
<p>We want to let you know that your {{ request.user.profile.account.card_type }} card ending
in {{ request.user.profile.account.card_last4 }} has expired.
<p>We want to let you know that your {{ user.profile.account.card_type }} card ending
in {{ user.profile.account.card_last4 }} has expired.
When you receive your new card, simply go to https://{{ site.domain }}{% url manage_account %}
to enter your card information. Thank you!</p>
<p>If you have any questions, we are happy to help. Simply email us at
<a href="mailto:support@gluejar.com">support@gluejar.com</a>.</p>
{% if request.user.profile.account %}
{% if user.profile.account %}
<p>The current card we have on file:</p>
<b>Card type:</b> {{ request.user.profile.account.card_type }}<br />
<b>Number:</b> ************{{ request.user.profile.account.card_last4 }}<br />
<b>Expiration date:</b> {{ request.user.profile.account.card_exp_month }}/{{ request.user.profile.account.card_exp_year }}.<br />
<b>Card type:</b> {{ user.profile.account.card_type }}<br />
<b>Number:</b> ************{{ user.profile.account.card_last4 }}<br />
<b>Expiration date:</b> {{ user.profile.account.card_exp_month }}/{{ user.profile.account.card_exp_year }}.<br />
<p>We use <a href="https://stripe.com/">Stripe</a> to keep your information secure.</p><br />
{% endif %}

View File

@ -1,24 +1,14 @@
{% load humanize %}
We want to give you advance notice that your {{ user.profile.account.card_type }} card ending in {{ user.profile.account.card_last4 }} will expire this month.
Your credit card is about to expire
We want to give you advance notice that your {{ request.user.profile.account.card_type }} card ending
in {{ request.user.profile.account.card_last4 }} will expire this month.
When you receive your new card, simply go to https://{{ site.domain }}{% url manage_account %}
to enter your card information. Thank you!
When you receive your new card, simply go to https://{{ site.domain }}{% url manage_account %} to enter your card information. Thank you!
If you have any questions, we are happy to help. Simply email us at support@gluejar.com.
{% if request.user.profile.account %}
{% if user.profile.account %}
The current card we have on file:
Card type: {{ request.user.profile.account.card_type }}
Number: ************{{ request.user.profile.account.card_last4 }}
Expiration date: {{ request.user.profile.account.card_exp_month }}/{{ request.user.profile.account.card_exp_year }}.
Card type: {{ user.profile.account.card_type }}
Number: ************{{ user.profile.account.card_last4 }}
Expiration date: {{ user.profile.account.card_exp_month }}/{{ user.profile.account.card_exp_year }}.
We use Stripe< to keep your information secure.
{% endif %}
Thank you for your support.
The Unglue.it team

View File

@ -1,30 +1,26 @@
{% extends "notification/notice_template.html" %}
{% load humanize %}
{% block comments_graphical %}
Your credit card is about to expire
{% endblock %}
{% block comments_textual %}
p>Your credit card is about to expire</p>
<p>We want to give you advance notice that your {{ request.user.profile.account.card_type }} card ending
in {{ request.user.profile.account.card_last4 }} will expire this month.
When you receive your new card, simply go to https://{{ site.domain }}{% url manage_account %}
<p>We want to give you advance notice that your {{ user.profile.account.card_type }} card ending
in {{ user.profile.account.card_last4 }} will expire this month.
When you receive your new card, simply go to
<a href="https://{{ site.domain }}{% url manage_account %}">Accounts &amp; Pledges</a>
to enter your card information. Thank you!</p>
<p>If you have any questions, we are happy to help. Simply email us at
<a href="mailto:support@gluejar.com">support@gluejar.com</a>.</p>
{% if request.user.profile.account %}
{% if user.profile.account %}
<p>The current card we have on file:</p>
<b>Card type:</b> {{ request.user.profile.account.card_type }}<br />
<b>Number:</b> ************{{ request.user.profile.account.card_last4 }}<br />
<b>Expiration date:</b> {{ request.user.profile.account.card_exp_month }}/{{ request.user.profile.account.card_exp_year }}.<br />
<b>Card type:</b> {{ user.profile.account.card_type }}<br />
<b>Number:</b> ************{{ user.profile.account.card_last4 }}<br />
<b>Expiration date:</b> {{ user.profile.account.card_exp_month }}/{{ user.profile.account.card_exp_year }}.<br />
<p>We use <a href="https://stripe.com/">Stripe</a> to keep your information secure.</p><br />
{% endif %}
Thank you for your support.
The Unglue.it team
{% endblock %}