Skip to content

Button Lead

A simple email collection component that automatically stores submissions in your database. Perfect for building a waitlist, newsletter signup, or lead generation form with minimal setup.

button-lead.html button-lead-dark.html

your_template.html
{% include 'components/button-lead.html' %}

The logic is handled by the lead view. It creates a new Lead object in the database.

app/views.py
def lead(request):
    if request.method == 'POST':
        email = request.POST.get('email')
        _, created = Lead.objects.get_or_create(email=email)
        # here you can create your own logic, e.g. sending a welcome email, redirecting to a thank you page, ...
        if created:
            messages.success(request, "You've been added to the waitlist 🎉.")
        else:
            messages.info(request, "You're already on the waitlist.")
    return redirect('index')