예제 #1
0
def send_lead(request):
    full_name = request.POST['full_name']
    email = request.POST['email']
    phone = request.POST['phone']
    msg = request.POST['msg']

    if request.method == 'POST' and recaptcha(request) and '' not in (
            full_name, email, phone, msg):
        query = Query()

        data = query.create(
            'crm.lead', 'create', {
                'name': 'plate-heat-exchanger.com.mx',
                'user_id': 110,
                'contact_name': full_name,
                'email_from': email,
                'phone': phone,
                'description': msg
            })

        return redirect('thanks')
    else:
        messages.add_message(
            request, messages.INFO,
            'Favor de llenar los campos con la información correcta.')
        return redirect('contact')
예제 #2
0
def send_lead(request):
    if request.method == 'POST' and recaptcha(request):
        full_name = request.POST['full_name']
        email = request.POST['email']
        phone = request.POST['phone']
        msg = request.POST['msg']

        query = Query()

        data = query.create(
            'crm.lead', 'create', {
                'name': 'enfriadores-aire.com.mx',
                'user_id': 110,
                'contact_name': full_name,
                'email_from': email,
                'phone': phone,
                'description': msg
            })
        return redirect('thanks')
    else:
        return redirect('index')
예제 #3
0
def lead(request):
    if request.method == 'POST' and recaptcha(request):
        full_name = request.POST['full_name']
        email = request.POST['email']
        phone = request.POST['phone']
        description = 'Producto: ' + request.POST[
            'product_name'], 'Número de parte Mesabi: ' + request.POST[
                'mpn'], 'Número de parte OEM: ' + request.POST[
                    'oempn'], 'Mensaje: ' + request.POST['msg']

        query = Query()

        data = query.create(
            'crm.lead', 'create', {
                'name': 'enfriadores-aire.com.mx',
                'user_id': 110,
                'contact_name': full_name,
                'email_from': email,
                'phone': phone,
                'description': description
            })
        return redirect('thanks')
    else:
        return redirect('index')