Exemplo n.º 1
0
def register(request):
    if request.method == 'POST':
        form = RegisterForm( request.POST, instance=Register() )

        if form.is_valid():
            try:
                form.save()
                feedbackEmail = FeedbackEmail()
                feedbackEmail.send_email(form)
            except Exception:
                return mail_response('false')
            return mail_response('true')
        else:
            return mail_response('false')
    else:
        raise Http404
Exemplo n.º 2
0
def save_lead(model, requestForm, form):
    if form.is_valid():
        try:
            form.save()
        except Exception:
            return mail_response('false')



        feedbackEmail = FeedbackEmail()
        feedbackEmail.send_email(form)

        contactLeads = ContactEmail()
        contactLeads.send_email(model, requestForm)

        return mail_response('true')
    else:
        return mail_response('false')