예제 #1
0
def landing_page(request):
    user = request.user
    if user.is_authenticated:
        form = LeadForm({'email': user.email})
        user_facade.visit_launch_landing_page(user, request.GET.get('utm_source', 'unknown'))
    else:
        form = LeadForm()
    return render(request, 'launch/landing_page.html', {'form': form})
예제 #2
0
def landing_page(request):
    user = request.user

    launch_status = get_launch_status()
    if launch_status == LAUNCH_STATUS_OPEN_CART and not request.GET.get('debug'):
        return redirect(reverse('checkout:bootcamp_lp'))

    if user.is_authenticated:
        form = LeadForm({'email': user.email})
        user_domain.visit_launch_landing_page(user, request.GET.get('utm_source', 'unknown'))
    else:
        form = LeadForm()
    return render(request, 'launch/landing_page.html', {'form': form})
예제 #3
0
def lead_form(request):
    form = LeadForm(request.POST)
    if not form.is_valid():
        return render(request, 'launch/form.html', {'form': form}, status=400)
    email = form.cleaned_data['email']
    user = request.user
    if user.is_authenticated:
        first_name = user.first_name
    else:
        first_name = email.split('@')[0]
    mailchimp_facade.create_or_update_with_no_role(
        first_name, email,
        f'turma-{find_most_recent_cohort().slug}-semana-do-programador')
    return redirect(reverse('launch:ty'))
예제 #4
0
def lead_form(request):
    form = LeadForm(request.POST)
    if not form.is_valid():
        return render(request, 'launch/form.html', {'form': form}, status=400)
    email = form.cleaned_data['email']
    first_name = form.cleaned_data['name']
    user = request.user
    if user.is_authenticated:
        email_marketing_facade.create_or_update_with_no_role(
            first_name,
            email,
            f'turma-{find_most_recent_cohort().slug}-semana-do-programador', id=user.id)
    else:
        email_marketing_facade.create_or_update_with_no_role(
            first_name,
            email,
            f'turma-{find_most_recent_cohort().slug}-semana-do-programador')
    return redirect(reverse('launch:cpl1'))
예제 #5
0
def lead_form(request):
    form = LeadForm(request.POST)
    if not form.is_valid():
        return render(request, 'launch/form.html', {'form': form}, status=400)
    email = form.cleaned_data['email']
    first_name = form.cleaned_data['name']
    user = request.user
    session_id = request.session.session_key
    if user.is_authenticated:
        subscription_domain.subscribe_with_no_role.delay(
            session_id,
            first_name,
            email,
            f'turma-{find_most_recent_cohort().slug}-semana-do-programador', id=user.id)
    else:
        subscription_domain.subscribe_with_no_role.delay(
            session_id,
            first_name,
            email,
            f'turma-{find_most_recent_cohort().slug}-semana-do-programador')
    return redirect(reverse('launch:ty'))