| Line 581... |
Line 581... |
| 581 |
In case you have any questions please visit <a href="$source_url/static/buy-online-and-pickup-in-store">Details on Pickup in Store</a>. If you still have more questions feel free to contact us 24/7 via <a href="$source_url/contact-us">$source_url/contact-us</a>
|
581 |
In case you have any questions please visit <a href="$source_url/static/buy-online-and-pickup-in-store">Details on Pickup in Store</a>. If you still have more questions feel free to contact us 24/7 via <a href="$source_url/contact-us">$source_url/contact-us</a>
|
| 582 |
</br><hr />
|
582 |
</br><hr />
|
| 583 |
"""
|
583 |
"""
|
| 584 |
|
584 |
|
| 585 |
html_footer = html_footer + html_pickup_text + """
|
585 |
html_footer = html_footer + html_pickup_text + """
|
| 586 |
Note:- With the onset of dense fog in North India, it severely hits the operations of our courier partners. We would like to mention that our deliveries might be slightly delayed. We look forward to your support and understanding with regards to anticipated delays.</br>
|
- |
|
| 587 |
<p>
|
586 |
<p>
|
| 588 |
Best Wishes,<br />
|
587 |
Best Wishes,<br />
|
| 589 |
$source_name Team
|
588 |
$source_name Team
|
| 590 |
</p>
|
589 |
</p>
|
| 591 |
</div>
|
590 |
</div>
|
| Line 602... |
Line 601... |
| 602 |
email_header = Template(html_header).substitute(dict(order_date = formated_order_date, customer_name = customer_name, source_url = source_url, otgLink = otgLink))
|
601 |
email_header = Template(html_header).substitute(dict(order_date = formated_order_date, customer_name = customer_name, source_url = source_url, otgLink = otgLink))
|
| 603 |
email_footer = Template(html_footer).substitute(dict(total_amount = "%.2f" % total_amount, emi_amount = "%.2f" % emi_amount, net_amount = "%.2f" % (total_amount-order.gvAmount), secret_code = random_text, store_address = store_address, store_delivery_date = store_delivery_date, source_url = source_url, source_name = source_name))
|
602 |
email_footer = Template(html_footer).substitute(dict(total_amount = "%.2f" % total_amount, emi_amount = "%.2f" % emi_amount, net_amount = "%.2f" % (total_amount-order.gvAmount), secret_code = random_text, store_address = store_address, store_delivery_date = store_delivery_date, source_url = source_url, source_name = source_name))
|
| 604 |
|
603 |
|
| 605 |
try:
|
604 |
try:
|
| 606 |
helper_client = HelperClient().get_client()
|
605 |
helper_client = HelperClient().get_client()
|
| - |
|
606 |
if transaction.orders[0].otg :
|
| - |
|
607 |
helper_client.saveUserEmailForSending([user_email], "", subject, email_header + html_table + email_footer, str(transaction_id), "TransactionInfo", [], ['rajneesh.arora@shop2020.in','rajveer.singh@shop2020.in','abhishek.mathur@shop2020.in','amit.sirohi@shop2020.in'])
|
| - |
|
608 |
else:
|
| 607 |
helper_client.saveUserEmailForSending([user_email], "", subject, email_header + html_table + email_footer, str(transaction_id), "TransactionInfo", [], [])
|
609 |
helper_client.saveUserEmailForSending([user_email], "", subject, email_header + html_table + email_footer, str(transaction_id), "TransactionInfo", [], [])
|
| 608 |
|
610 |
|
| 609 |
return True
|
611 |
return True
|
| 610 |
except Exception as e:
|
612 |
except Exception as e:
|
| 611 |
print e
|
613 |
print e
|
| 612 |
return False
|
614 |
return False
|
| Line 845... |
Line 847... |
| 845 |
email_header = Template(html_header).substitute(dict(order_date = formated_order_date, customer_name = customer_name, pickup_text = pickup_text, source_url = source_url))
|
847 |
email_header = Template(html_header).substitute(dict(order_date = formated_order_date, customer_name = customer_name, pickup_text = pickup_text, source_url = source_url))
|
| 846 |
email_footer = Template(html_footer).substitute(dict(total_amount = "%.2f" % total_amount, source_name = source_name))
|
848 |
email_footer = Template(html_footer).substitute(dict(total_amount = "%.2f" % total_amount, source_name = source_name))
|
| 847 |
|
849 |
|
| 848 |
try:
|
850 |
try:
|
| 849 |
helper_client = HelperClient(host_key = "helper_service_server_host_prod").get_client()
|
851 |
helper_client = HelperClient(host_key = "helper_service_server_host_prod").get_client()
|
| - |
|
852 |
if order.otg:
|
| - |
|
853 |
helper_client.saveUserEmailForSending([user_email], "", subject, email_header + html_table + email_footer, str(order.id), "DeliverySuccess", [], ['rajneesh.arora@shop2020.in','rajveer.singh@shop2020.in','abhishek.mathur@shop2020.in','amit.sirohi@shop2020.in'])
|
| - |
|
854 |
else:
|
| 850 |
helper_client.saveUserEmailForSending([user_email], "", subject, email_header + html_table + email_footer, str(order.id), "DeliverySuccess", [], [])
|
855 |
helper_client.saveUserEmailForSending([user_email], "", subject, email_header + html_table + email_footer, str(order.id), "DeliverySuccess", [], [])
|
| 851 |
return True
|
856 |
return True
|
| 852 |
except Exception as e:
|
857 |
except Exception as e:
|
| 853 |
print e
|
858 |
print e
|
| 854 |
return False
|
859 |
return False
|
| 855 |
|
860 |
|
| Line 3421... |
Line 3426... |
| 3421 |
# Calling helper service on production
|
3426 |
# Calling helper service on production
|
| 3422 |
helperClient = HelperClient(host_key = "helper_service_server_host_prod").get_client()
|
3427 |
helperClient = HelperClient(host_key = "helper_service_server_host_prod").get_client()
|
| 3423 |
try:
|
3428 |
try:
|
| 3424 |
emailSubject = 'Shipping Details for Order ID: ' + str(order.id)
|
3429 |
emailSubject = 'Shipping Details for Order ID: ' + str(order.id)
|
| 3425 |
emailBody = get_shipping_confirmation_email_body(order)
|
3430 |
emailBody = get_shipping_confirmation_email_body(order)
|
| - |
|
3431 |
if order.otg:
|
| - |
|
3432 |
helperClient.saveUserEmailForSending([order.customer_email], None, emailSubject, emailBody, str(order.id), 'ShippingConfirmation', [], ['rajneesh.arora@shop2020.in','rajveer.singh@shop2020.in','abhishek.mathur@shop2020.in','amit.sirohi@shop2020.in'])
|
| - |
|
3433 |
else:
|
| 3426 |
helperClient.saveUserEmailForSending([order.customer_email], None, emailSubject, emailBody, str(order.id), 'ShippingConfirmation', [], [])
|
3434 |
helperClient.saveUserEmailForSending([order.customer_email], None, emailSubject, emailBody, str(order.id), 'ShippingConfirmation', [], [])
|
| - |
|
3435 |
|
| 3427 |
except Exception as e:
|
3436 |
except Exception as e:
|
| 3428 |
print e
|
3437 |
print e
|
| 3429 |
|
3438 |
|
| 3430 |
def get_order_distribution_by_status(start_date, end_date):
|
3439 |
def get_order_distribution_by_status(start_date, end_date):
|
| 3431 |
query = session.query(Order.status, func.count(Order.id)).group_by(Order.status)
|
3440 |
query = session.query(Order.status, func.count(Order.id)).group_by(Order.status)
|