Beispiel #1
0
def notify_user(request):
    """
    Notify the user
    """
    order_id = None
    email = None

    if request.method == "POST":
        if 'order_id' in request.POST:
            order_id = request.POST['order_id']
        if 'email' in request.POST:
            email = request.POST['email']


#
        if not order_id or not email:
            return

        order_lst = NewOrderRecord.objects.filter(order_serial_no=order_id)
        order = order_lst[0]
        state = order.order_state
        user = order.order_by_one
        print "Notifying the user [%s]; order state is [%s]" % (email, state)

        EmailUtils.notify_order_state_to_user(email, user, state)

    return HttpResponseRedirect('/administrator/')