示例#1
0
def push_shopcallback(request):
    """
    Its Ajax posted shop callback
    """
    try:
        cb = ShopCallback()
        cb.ip = request.META['REMOTE_ADDR']
        cb.user_agent = request.META['HTTP_USER_AGENT']
        cb.clientname = request.POST.get('clientname')
        cb.clientphone = request.POST.get('clientphone')
        cb.save()
        mail_dict = {'callback': cb}
        recipients = [settings.SHOP_MANAGER]
        subject = 'emails/callback_admin_subject.txt'
        body = 'emails/callback_admin_body.txt'
        send_template_mail(subject, body, mail_dict, recipients)
        payload = {'success': True}
    except:
        payload = {'success': False}
    return AjaxLazyAnswer(payload)
示例#2
0
def push_shopcallback(request):
    """
    Its Ajax posted shop callback
    """
    try:
        cb = ShopCallback()
        cb.ip = request.META['REMOTE_ADDR']
        cb.user_agent = request.META['HTTP_USER_AGENT']
        cb.clientname = request.POST.get('clientname')
        cb.clientphone = request.POST.get('clientphone')
        cb.save()
        mail_dict = {'callback': cb}
        recipients = [settings.SHOP_MANAGER]
        subject = 'emails/callback_admin_subject.txt'
        body = 'emails/callback_admin_body.txt'
        send_template_mail(subject, body, mail_dict, recipients)
        payload = {'success': True}
    except:
        payload = {'success': False}
    return AjaxLazyAnswer(payload)
示例#3
0
文件: ajax.py 项目: kingctan/nnmware
def push_shopcallback(request):
    """
    Its Ajax posted shop callback
    """
    try:
        cb = ShopCallback()
        cb.ip = request.META["REMOTE_ADDR"]
        cb.user_agent = request.META["HTTP_USER_AGENT"]
        cb.clientname = request.POST.get("clientname")
        cb.clientphone = request.POST.get("clientphone")
        cb.save()
        mail_dict = {"callback": cb}
        recipients = [settings.SHOP_MANAGER]
        subject = "emails/callback_admin_subject.txt"
        body = "emails/callback_admin_body.txt"
        send_template_mail(subject, body, mail_dict, recipients)
        payload = {"success": True}
    except:
        payload = {"success": False}
    return AjaxLazyAnswer(payload)
示例#4
0
def push_quickorder(request):
    """
    Its Ajax posted shop quick order
    """
    try:
        cb = ShopCallback()
        cb.ip = request.META['REMOTE_ADDR']
        cb.user_agent = request.META['HTTP_USER_AGENT']
        cb.clientname = request.POST.get('clientname')
        cb.clientphone = request.POST.get('clientphone')
        cb.description = request.POST.get('product_url')
        cb.quickorder = True
        cb.save()
        mail_dict = {'callback': cb}
        recipients = [settings.SHOP_MANAGER]
        subject = 'emails/quickorder_admin_subject.txt'
        body = 'emails/quickorder_admin_body.txt'
        send_template_mail(subject, body, mail_dict, recipients)
        payload = {'success': True}
    except:
        payload = {'success': False}
    return ajax_answer_lazy(payload)
示例#5
0
def push_quickorder(request):
    """
    Its Ajax posted shop quick order
    """
    try:
        cb = ShopCallback()
        cb.ip = request.META['REMOTE_ADDR']
        cb.user_agent = request.META['HTTP_USER_AGENT']
        cb.clientname = request.POST.get('clientname')
        cb.clientphone = request.POST.get('clientphone')
        cb.description = request.POST.get('product_url')
        cb.quickorder = True
        cb.save()
        mail_dict = {'callback': cb}
        recipients = [settings.SHOP_MANAGER]
        subject = 'emails/quickorder_admin_subject.txt'
        body = 'emails/quickorder_admin_body.txt'
        send_template_mail(subject, body, mail_dict, recipients)
        payload = {'success': True}
    except:
        payload = {'success': False}
    return ajax_answer_lazy(payload)