| Line 765... |
Line 765... |
| 765 |
discount = min(max_discount,delayedDays*50)
|
765 |
discount = min(max_discount,delayedDays*50)
|
| 766 |
promotion_client = PromotionClient().get_client()
|
766 |
promotion_client = PromotionClient().get_client()
|
| 767 |
endOn = order.delivery_timestamp + datetime.timedelta(days = 30)
|
767 |
endOn = order.delivery_timestamp + datetime.timedelta(days = 30)
|
| 768 |
endOn = to_java_date(endOn)
|
768 |
endOn = to_java_date(endOn)
|
| 769 |
otgCoupon = promotion_client.createCoupon(28, endOn, order.customer_email, discount, False, 1, "otg")
|
769 |
otgCoupon = promotion_client.createCoupon(28, endOn, order.customer_email, discount, False, 1, "otg")
|
| 770 |
thank_you_html = '$prodName ordered by you has been delivered. We apologise for a delay of $delayedDays business days. As per our <b>On Time Guarantee</b> you have won a Gift Voucher worth <b>Rs.$discount</b>. Your unique Gift Voucher Code is <b>$otgCoupon</b>. You can use the same to buy any Mobile, Camera, Laptop, Tablet or Accessory from our website.'
|
770 |
thank_you_html = '$prodName ordered by you has been delivered. We apologise for a delay of $delayedDays business days. As per our <b>On Time Guarantee</b> you have won a Gift Voucher worth <b>Rs.$discount</b>. Your unique Gift Voucher Code is <b>$otgCoupon</b>. You can use the same to buy any Mobile, Camera, Laptop, Tablet, Accessory or Mobile/DTH Recharge from our website.'
|
| 771 |
thank_you_html = Template(thank_you_html).substitute(dict(prodName=order.lineitems[0], delayedDays = delayedDays, discount = discount, otgCoupon = otgCoupon))
|
771 |
thank_you_html = Template(thank_you_html).substitute(dict(prodName=order.lineitems[0], delayedDays = delayedDays, discount = discount, otgCoupon = otgCoupon))
|
| 772 |
elif fda:
|
772 |
elif fda:
|
| 773 |
fdaFormattedString = order.first_dlvyatmp_timestamp.strftime("%A, %d. %B %Y")
|
773 |
fdaFormattedString = order.first_dlvyatmp_timestamp.strftime("%A, %d. %B %Y")
|
| 774 |
thank_you_html = str(order.lineitems[0]) + """ ordered by you has been delivered. The First Delivery attempt was made on """+ fdaFormattedString +""" , within our commited estimated time for delivery."""
|
774 |
thank_you_html = str(order.lineitems[0]) + """ ordered by you has been delivered. The First Delivery attempt was made on """+ fdaFormattedString +""" , within our commited estimated time for delivery."""
|
| 775 |
|
775 |
|