Subversion Repositories SmartDukaan

Rev

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

Rev 34179 Rev 34204
Line 539... Line 539...
539
    const re = /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
539
    const re = /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
540
    return re.test(String(email).toLowerCase());
540
    return re.test(String(email).toLowerCase());
541
}
541
}
542
function sendInvoiceOnWApp(orderId){
542
function sendInvoiceOnWApp(orderId){
543
    let whatsAppMobile = $('#whatsApp-invoice-number').val();
543
    let whatsAppMobile = $('#whatsApp-invoice-number').val();
-
 
544
    if(!whatsAppMobile){
-
 
545
        alert('Please enter valid whatsApp number');
-
 
546
        return;
-
 
547
    }
-
 
548
    if(whatsAppMobile.length<10){
-
 
549
        alert('Mobile number must be at least 10 digits');
-
 
550
        return;
-
 
551
    }
-
 
552
    if(confirm('Are you sure you want to send invoice on whatsApp?')){
544
    doPutAjaxRequestHandler(`${context}/sendInvoiceOnWhatsApp?orderId=${orderId}&whatsAppMobile=${whatsAppMobile}`, function (response) {
553
        doPutAjaxRequestHandler(`${context}/sendInvoiceOnWhatsApp?orderId=${orderId}&whatsAppMobile=${whatsAppMobile}`, function (response) {
-
 
554
            console.log("sendInvoiceOnWhatsApp res - ",response);
545
        if(response){
555
            if(response){
546
            alert('Invoice send successfully on whatsApp');
556
                alert('Invoice send successfully on whatsApp');
-
 
557
            }
547
        }
558
        });
-
 
559
    }else {
-
 
560
        return;
548
    });
561
    }
-
 
562
 
549
 
563
 
550
}
564
}