Subversion Repositories SmartDukaan

Rev

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

Rev 6654 Rev 6655
Line 3358... Line 3358...
3358
    <p>
3358
    <p>
3359
        We are pleased to inform that we have shipped the order: $order_id for your product $product_name on $shipping_datetime. 
3359
        We are pleased to inform that we have shipped the order: $order_id for your product $product_name on $shipping_datetime. 
3360
        The shipment will be delivered to you via $courier_name Courier Service vide AWB# $awb.
3360
        The shipment will be delivered to you via $courier_name Courier Service vide AWB# $awb.
3361
    </p>
3361
    </p>
3362
    <p>
3362
    <p>
3363
        Expected delivery date for your order is $expected_delivery_date. 
3363
        Expected delivery date for your order is $expected_delivery_date.
-
 
3364
        $otg_text 
3364
        The product can be delivered to you between business hours of 10am to 6pm. 
3365
        The product can be delivered to you between business hours of 10am to 6pm. 
3365
        You can login to your account on our site and under "Open Orders", please click the AWB and check the current shipment updates for your product.
3366
        You can login to your account on our site and under "Open Orders", please click the AWB and check the current shipment updates for your product.
3366
    </p>
3367
    </p>
3367
    <p>
3368
    <p>
3368
        For scheduling the delivery of your product at some specific timings, we recommend you to contact the helpline for $courier_name with your complete AWB#.
3369
        For scheduling the delivery of your product at some specific timings, we recommend you to contact the helpline for $courier_name with your complete AWB#.
Line 3385... Line 3386...
3385
    dt = datetime.datetime.strptime(str(order.shipping_timestamp), "%Y-%m-%d %H:%M:%S")
3386
    dt = datetime.datetime.strptime(str(order.shipping_timestamp), "%Y-%m-%d %H:%M:%S")
3386
    shipping_date = dt.strftime("%A, %d %B %Y %I:%M%p")
3387
    shipping_date = dt.strftime("%A, %d %B %Y %I:%M%p")
3387
    product = "%s %s %s" % (order.lineitems[0].brand, order.lineitems[0].model_name, order.lineitems[0].model_number)
3388
    product = "%s %s %s" % (order.lineitems[0].brand, order.lineitems[0].model_name, order.lineitems[0].model_number)
3388
    new_expected_delivery_timestamp = datetime.datetime.now() + timedelta(adjust_delivery_time(datetime.datetime.now(), (logistics_info.deliveryTime - logistics_info.shippingTime)))
3389
    new_expected_delivery_timestamp = datetime.datetime.now() + timedelta(adjust_delivery_time(datetime.datetime.now(), (logistics_info.deliveryTime - logistics_info.shippingTime)))
3389
    new_expected_delivery_date = new_expected_delivery_timestamp.strftime("%A, %d %B %Y")
3390
    new_expected_delivery_date = new_expected_delivery_timestamp.strftime("%A, %d %B %Y")
-
 
3391
    otg_text = ""
-
 
3392
    if order.otg:
-
 
3393
        if order.cod:
-
 
3394
            new_expected_delivery_timestamp = new_expected_delivery_timestamp.replace(hour=COD_SHIPPING_CUTOFF_TIME, minute=0, second=0)
-
 
3395
        else:
-
 
3396
            new_expected_delivery_timestamp = new_expected_delivery_timestamp.replace(hour=PREPAID_SHIPPING_CUTOFF_TIME, minute=0, second=0)
-
 
3397
        if new_expected_delivery_timestamp > order.promised_delivery_time:
-
 
3398
            otg_text = "Your order is covered under our On Time Guarantee; We Pay if we Delay. We apologize in advance for the expected delay from our initial promised delivery date of " + new_expected_delivery_date + ". Your will receive a Gift Voucher Code at time of delivery based on the actual delay. You can use the same to buy any Mobile, Camera, Laptop, Tablet or Accessory from our website."
-
 
3399
        elif new_expected_delivery_timestamp < order.promised_delivery_time:
-
 
3400
            otg_text = "Your order is covered under our On Time Guarantee; We Pay if we Delay. We are happy to inform you that we expect to deliver your order before our our initial promised delivery date of " + new_expected_delivery_date + "."
-
 
3401
        else:            
-
 
3402
            otg_text = "Your order is covered under our On Time Guarantee; We Pay if we Delay. We are committed to deliver your order by our initial promised delivery date of " + new_expected_delivery_date + "."
-
 
3403
        
-
 
3404
         
-
 
3405
 
-
 
3406
 
3390
    info = dict(order_id = order.id, product_name = product, shipping_datetime = shipping_date, awb = order.airwaybill_no, expected_delivery_date = new_expected_delivery_date, courier_name = provider_name, courier_phone = provider_phone, source_name = source_name)
3407
    info = dict(order_id = order.id, product_name = product, shipping_datetime = shipping_date, awb = order.airwaybill_no, expected_delivery_date = new_expected_delivery_date, courier_name = provider_name, courier_phone = provider_phone, source_name = source_name, otg_text = otg_text)
3391
    return Template(html).substitute(info)
3408
    return Template(html).substitute(info)
3392
 
3409
 
3393
def enqueue_shipping_confirmation_email(order):
3410
def enqueue_shipping_confirmation_email(order):
3394
    # Calling helper service on production
3411
    # Calling helper service on production
3395
    helperClient = HelperClient(host_key = "helper_service_server_host_prod").get_client()
3412
    helperClient = HelperClient(host_key = "helper_service_server_host_prod").get_client()