| Line 3513... |
Line 3513... |
| 3513 |
<html>
|
3513 |
<html>
|
| 3514 |
<body>
|
3514 |
<body>
|
| 3515 |
<div>
|
3515 |
<div>
|
| 3516 |
<p>
|
3516 |
<p>
|
| 3517 |
Hello $email,<br /><br />
|
3517 |
Hello $email,<br /><br />
|
| 3518 |
Thanks for placing order with us. Following are the details of your order:
|
3518 |
Thanks for placing recharge order with us. Following are the details of your recharge order:
|
| 3519 |
</p>
|
3519 |
</p>
|
| 3520 |
<div>
|
3520 |
<div>
|
| 3521 |
Order Id : $order_id </br>
|
3521 |
Order Id : $order_id </br>
|
| 3522 |
Order Date : $order_date </br>
|
3522 |
Order Date : $order_date </br>
|
| 3523 |
Order Amount : Rs. $order_amount </br>
|
3523 |
Order Amount : Rs. $order_amount </br>
|
| Line 3533... |
Line 3533... |
| 3533 |
if recharge_order.status == RechargeOrderStatus.RECHARGE_SUCCESSFUL:
|
3533 |
if recharge_order.status == RechargeOrderStatus.RECHARGE_SUCCESSFUL:
|
| 3534 |
status = "Recharge Successful"
|
3534 |
status = "Recharge Successful"
|
| 3535 |
message = ""
|
3535 |
message = ""
|
| 3536 |
elif recharge_order.status == RechargeOrderStatus.RECHARGE_FAILED:
|
3536 |
elif recharge_order.status == RechargeOrderStatus.RECHARGE_FAILED:
|
| 3537 |
status = "Recharge Failed"
|
3537 |
status = "Recharge Failed"
|
| - |
|
3538 |
message = """
|
| 3538 |
message = "Due to network failure, we could not process your recharge. We have credited the amount to your recharge wallet. You can use wallet amount to recharge again. <a href='$source_url/static/recharge-faq'>Learn More</a>"
|
3539 |
Due to network failure, we could not process your recharge. We have credited the amount to your recharge wallet. You can use wallet amount to recharge again. <a href="$source_url/static/recharge-faq">Learn More</a>
|
| - |
|
3540 |
"""
|
| 3539 |
elif recharge_order.status == RechargeOrderStatus.PAYMENT_PENDING:
|
3541 |
elif recharge_order.status == RechargeOrderStatus.PAYMENT_PENDING:
|
| 3540 |
status = "Recharge Under Process"
|
3542 |
status = "Recharge Under Process"
|
| - |
|
3543 |
message = """
|
| 3541 |
message = "Due to network failure, we could not retrieve the status of your recharge. In case your recharge is not processed, we will credit amount to your recharge wallet. You can use wallet amount to recharge again. <a href='$source_url/static/recharge-faq'>Learn More</a>"
|
3544 |
Due to network failure, we could not retrieve the status of your recharge. In case your recharge is not processed, we will credit amount to your recharge wallet. You can use wallet amount to recharge again. <a href="$source_url/static/recharge-faq">Learn More</a>
|
| - |
|
3545 |
"""
|
| 3542 |
|
3546 |
|
| 3543 |
message = message + '<br /> In case of any problem, please <a href="$source_url/contact-us">contact us</a>'
|
3547 |
message = message + '<br /> In case of any problem, please <a href="$source_url/contact-us">contact us</a>'
|
| 3544 |
|
3548 |
|
| 3545 |
html_footer = """
|
3549 |
html_footer = """
|
| 3546 |
<p>
|
3550 |
<p>
|
| Line 3557... |
Line 3561... |
| 3557 |
providerName = get_provider(recharge_order.mobileOperatorId).name
|
3561 |
providerName = get_provider(recharge_order.mobileOperatorId).name
|
| 3558 |
if isinstance(recharge_order, DTHRechargeOrder):
|
3562 |
if isinstance(recharge_order, DTHRechargeOrder):
|
| 3559 |
deviceNumber = recharge_order.dthAccountNumber
|
3563 |
deviceNumber = recharge_order.dthAccountNumber
|
| 3560 |
providerName = get_provider(recharge_order.dthOperatorId).name
|
3564 |
providerName = get_provider(recharge_order.dthOperatorId).name
|
| 3561 |
|
3565 |
|
| - |
|
3566 |
display_order_id = recharge_order.idPrefix + str(recharge_order.id)
|
| 3562 |
email = recharge_order.userEmailId
|
3567 |
email = recharge_order.userEmailId
|
| 3563 |
dt = datetime.datetime.strptime(str(recharge_order.creationTimestamp), "%Y-%m-%d %H:%M:%S")
|
3568 |
dt = datetime.datetime.strptime(str(recharge_order.creationTimestamp), "%Y-%m-%d %H:%M:%S")
|
| 3564 |
formated_order_date = dt.strftime("%A, %d. %B %Y %I:%M%p")
|
3569 |
formated_order_date = dt.strftime("%A, %d. %B %Y %I:%M%p")
|
| 3565 |
|
3570 |
|
| 3566 |
email_header = Template(html_header).substitute(dict(order_id = recharge_order.id, order_date = formated_order_date, email = email, source_url = source_url, order_amount = recharge_order.totalAmount, order_status = status, message = message, device_number = deviceNumber, service_provider = providerName))
|
3571 |
email_header = Template(html_header).substitute(dict(order_id = display_order_id, order_date = formated_order_date, email = email, source_url = source_url, order_amount = recharge_order.totalAmount, order_status = status, message = message, device_number = deviceNumber, service_provider = providerName))
|
| 3567 |
email_footer = Template(html_footer).substitute(dict(source_url = source_url, source_name = source_name))
|
3572 |
email_footer = Template(html_footer).substitute(dict(source_url = source_url, source_name = source_name))
|
| 3568 |
|
3573 |
|
| 3569 |
try:
|
3574 |
try:
|
| 3570 |
helper_client = HelperClient().get_client()
|
3575 |
helper_client = HelperClient().get_client()
|
| 3571 |
helper_client.saveUserEmailForSending([email], "", source_name + " - Recharge Order Details", email_header + email_footer, str(recharge_order.id), "RechargeInfo", [], [])
|
3576 |
helper_client.saveUserEmailForSending([email], "", source_name + " - Recharge Order Details", email_header + email_footer, str(recharge_order.id), "RechargeInfo", [], [])
|