fix
This commit is contained in:
@@ -24,6 +24,7 @@ from rowers.tasks import (
|
|||||||
handle_send_email_subscription_update,
|
handle_send_email_subscription_update,
|
||||||
handle_send_email_subscription_create,
|
handle_send_email_subscription_create,
|
||||||
handle_send_email_failed_cancel,
|
handle_send_email_failed_cancel,
|
||||||
|
handle_send_email_transaction_notification,
|
||||||
)
|
)
|
||||||
|
|
||||||
import pandas as pd
|
import pandas as pd
|
||||||
@@ -219,6 +220,8 @@ def make_payment(rower,data):
|
|||||||
try:
|
try:
|
||||||
job = myqueue(queuehigh,handle_send_email_transaction,
|
job = myqueue(queuehigh,handle_send_email_transaction,
|
||||||
name, rower.user.email, amount)
|
name, rower.user.email, amount)
|
||||||
|
job = myqueue(queuehigh,handle_send_email_transation_notification,
|
||||||
|
name.rower.user.email, amount, additional_text)
|
||||||
except: # pragma: no cover
|
except: # pragma: no cover
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|||||||
@@ -1341,6 +1341,33 @@ def handle_send_email_transaction(
|
|||||||
|
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
|
@app.task
|
||||||
|
def handle_send_email_transaction_notification(
|
||||||
|
username, useremail, amount, additional_text, **kwargs):
|
||||||
|
|
||||||
|
if 'debug' in kwargs: # pragma: no cover
|
||||||
|
debug = kwargs['debug']
|
||||||
|
else:
|
||||||
|
debug = True
|
||||||
|
|
||||||
|
subject = "Rowsandall Payment Confirmation"
|
||||||
|
|
||||||
|
from_email = 'Rowsandall <admin@rowsandall.com>'
|
||||||
|
|
||||||
|
d = {
|
||||||
|
'name': username,
|
||||||
|
'siteurl': siteurl,
|
||||||
|
'amount': amount,
|
||||||
|
'reason':additional_text,
|
||||||
|
}
|
||||||
|
|
||||||
|
res = send_template_email(from_email,['support@rowsandall.com'],
|
||||||
|
subject,
|
||||||
|
'instantplansold.html',
|
||||||
|
d, **kwargs)
|
||||||
|
|
||||||
|
return 1
|
||||||
|
|
||||||
@app.task
|
@app.task
|
||||||
def handle_send_email_failed_cancel(
|
def handle_send_email_failed_cancel(
|
||||||
name, email, username, id, **kwargs):
|
name, email, username, id, **kwargs):
|
||||||
|
|||||||
17
rowers/templates/instantplansold.html
Normal file
17
rowers/templates/instantplansold.html
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
{% extends "emailbase.html" %}
|
||||||
|
|
||||||
|
{% block body %}
|
||||||
|
<p>User <strong>{{ name }}</strong> made a payment.</p>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
{{ additional_text }}
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
Price: €{{ price }}.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
Best Regards, the Rowsandall Team
|
||||||
|
</p>
|
||||||
|
{% endblock %}
|
||||||
@@ -136,7 +136,7 @@ def buy_trainingplan_view(request,id=0):
|
|||||||
try:
|
try:
|
||||||
targetid = cd['target']
|
targetid = cd['target']
|
||||||
target = TrainingTarget.objects.get(id=int(targetid))
|
target = TrainingTarget.objects.get(id=int(targetid))
|
||||||
except KeyError:
|
except (KeyError,ValueError):
|
||||||
try:
|
try:
|
||||||
targetid = request.POST['target']
|
targetid = request.POST['target']
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user