Subversion Repositories SmartDukaan

Rev

Rev 13359 | Rev 13379 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 13359 Rev 13377
Line 1200... Line 1200...
1200
            </p>
1200
            </p>
1201
            </div>
1201
            </div>
1202
            </body>
1202
            </body>
1203
            </html>
1203
            </html>
1204
    """
1204
    """
1205
 
-
 
-
 
1205
    pickup_text =" "
1206
    if hasPickupStoreOrder:
1206
    if hasPickupStoreOrder:
1207
        pickup_text = "Pickup Date: " + order.delivery_timestamp.strftime("%A, %d. %B %Y %I:%M%p")
1207
        pickup_text = "Pickup Date: " + order.delivery_timestamp.strftime("%A, %d. %B %Y %I:%M%p")
1208
        thank_you_html = """
1208
        thank_you_html = """
1209
        Thank you for shopping with us and picking up your order in Store. 
1209
        Thank you for shopping with us and picking up your order in Store. 
1210
    
1210
    
1211
        Following are the details of your order for which the pickup has happened. <br> If you have not picked up this product please <a href="$source_url/contact-us" target="_blank">contact us</a> immediately.<br>
1211
        Following are the details of your order $master_order_id for which the pickup has happened. <br> If you have not picked up this product please <a href="$source_url/contact-us" target="_blank">contact us</a> immediately.<br>
1212
        If you are happy with our services please join us on <a href="https://twitter.com/saholic">Twitter</a>, <a href="http://www.facebook.com/mysaholic">Facebook Page</a> and help us spread the word
1212
        If you are happy with our services please join us on <a href="https://twitter.com/saholic">Twitter</a>, <a href="http://www.facebook.com/mysaholic">Facebook Page</a> and help us spread the word
1213
        """
1213
        """
1214
    else:
1214
    else:
1215
        if hasOtg:
1215
        if hasOtg:
1216
            delayed = False
1216
            delayed = False
Line 1239... Line 1239...
1239
                endOn =  order.delivery_timestamp + datetime.timedelta(days = 30)
1239
                endOn =  order.delivery_timestamp + datetime.timedelta(days = 30)
1240
                expiry = endOn.strftime("%A, %d. %B %Y")
1240
                expiry = endOn.strftime("%A, %d. %B %Y")
1241
                endOn = to_java_date(endOn)
1241
                endOn = to_java_date(endOn)
1242
                arguments = "{\"endOn\":" + str(endOn) + ", \"emails\":[\"" + order.customer_email + "\"], \"couponType\":\"both\", \"usage_limit_for_user\":1, \"isCod\":False, \"discount\":" + str(discount) + "}"
1242
                arguments = "{\"endOn\":" + str(endOn) + ", \"emails\":[\"" + order.customer_email + "\"], \"couponType\":\"both\", \"usage_limit_for_user\":1, \"isCod\":False, \"discount\":" + str(discount) + "}"
1243
                otgCoupon = promotion_client.createCoupon(28,CouponCategory.CUSTOMER_SATISFACTION , '', arguments, False, "otg")
1243
                otgCoupon = promotion_client.createCoupon(28,CouponCategory.CUSTOMER_SATISFACTION , '', arguments, False, "otg")
1244
                thank_you_html = """Following items in your order """+logisticsTxnId+""" have been delivered. We apologise for a delay of """+delayedDays+""" days<br/>
1244
                thank_you_html = """Following items in your order $master_order_id have been delivered. We apologise for a delay of """+delayedDays+""" days<br/>
1245
                                As per our On Time Guarantee Please accept a Gift Voucher worth Rs."""+str(discount)+"""as a token of our apology.
1245
                                As per our On Time Guarantee Please accept a Gift Voucher worth Rs."""+str(discount)+"""as a token of our apology.
1246
                                Your unique Gift Voucher Code is """+otgCoupon+""" Gift Voucher Expiry Date: """+expiry+"""<br/>
1246
                                Your unique Gift Voucher Code is """+otgCoupon+""" Gift Voucher Expiry Date: """+expiry+"""<br/>
1247
                                You can use the same to buy any Mobile, Camera, Laptop, Tablet, Accessory or Mobile/DTH Recharge from our website.</br/>
1247
                                You can use the same to buy any Mobile, Camera, Laptop, Tablet, Accessory or Mobile/DTH Recharge from our website.</br/>
1248
                                If you are happy with our services please join us on <a href="https://twitter.com/saholic">Twitter</a>, <a href="http://www.facebook.com/mysaholic">Facebook Page</a> and help us spread the word
1248
                                If you are happy with our services please join us on <a href="https://twitter.com/saholic">Twitter</a>, <a href="http://www.facebook.com/mysaholic">Facebook Page</a> and help us spread the word
1249
                                """
1249
                                """
Line 1287... Line 1287...
1287
    dt = datetime.datetime.strptime(str(order_date), "%Y-%m-%d %H:%M:%S")
1287
    dt = datetime.datetime.strptime(str(order_date), "%Y-%m-%d %H:%M:%S")
1288
    formated_order_date = dt.strftime("%A, %d. %B %Y %I:%M%p")
1288
    formated_order_date = dt.strftime("%A, %d. %B %Y %I:%M%p")
1289
    
1289
    
1290
    complete_html = html_header + thank_you_html + html
1290
    complete_html = html_header + thank_you_html + html
1291
    
1291
    
1292
    email_html = Template(complete_html).substitute(dict(order_date = formated_order_date, customer_name = customer_name, pickup_text = pickup_text, source_url = source_url, source_name = source_name, freebie_text = freebie_text, insurance_text = insuranceText))
1292
    email_html = Template(complete_html).substitute(dict(master_order_id = logisticsTxnId, order_date = formated_order_date, customer_name = customer_name, pickup_text = pickup_text, source_url = source_url, source_name = source_name, freebie_text = freebie_text, insurance_text = insuranceText))
1293
    
1293
    
1294
    try:
1294
    try:
1295
        helper_client = HelperClient(host_key = "helper_service_server_host_prod").get_client()
1295
        helper_client = HelperClient(host_key = "helper_service_server_host_prod").get_client()
1296
        helper_client.saveUserEmailForSending([user_email], "", subject, email_html, logisticsTxnId, "DeliverySuccess", [], [], order.source)
1296
        helper_client.saveUserEmailForSending([user_email], "", subject, email_html, logisticsTxnId, "DeliverySuccess", [], [], order.source)
1297
        
1297