Ejemplo n.º 1
0
def subscribe(request):
    try:
        model = get_object_or_404(Subscriber,email=request.GET['email'],pk=decrypt_token(request.GET['token']),verified=False)
        model.verified = True
        model.save()
        mail_managers("New mailing-list subscriber - %s" % request.GET['email'],"Subject says it all.")
        messages.success(request,"Your email address has been confirmed. Welcome!")
        return redirect("/")
    except:
        raise Http404
Ejemplo n.º 2
0
def unsubscribe(request):
    model = get_object_or_404(Subscriber,email=request.GET['email'],pk=decrypt_token(request.GET['token']))
    model.delete()
    mail_managers("Mailing-list unsubscriber - %s" % request.GET['email'],"Subject says it all.")
    return HttpResponse("Your email address has been removed from the list. So long!")