Ejemplo n.º 1
0
def sendEmail():
    users = userdb.getAllUserInfo()
    userList = users["userList"]
    userCount = users["userCount"]
    for user in userList:
        for catalog in user["subscribe"]:
            print newdb.get({"newCatalog": catalog})
Ejemplo n.º 2
0
def sendEmail(email, subscribe):
    result = False
    newsList = []
    for s in subscribe: 
        newsList.append(newdb.get({'newCatalog': s})["news"])
    print "send"
    result = EmailSender.send_mail("中国好班长订阅内容", HTMLgenerator.generateForSendEmail(newsList), [email])
    return {"result": result}
Ejemplo n.º 3
0
def apiTemp_getNewsByCatalog():
    if request.method == "POST":
        formJson = request.get_json()
        returnJson = newdb.get({
            "newCatalog":
            escape(formJson["newCatalog"])
            if formJson.has_key("newCatalog") else ''
        })
        return jsonify(returnJson)
Ejemplo n.º 4
0
def sendEmail(email, subscribe):
    result = False
    newsList = []
    for s in subscribe:
        newsList.append(newdb.get({'newCatalog': s})["news"])
    print "send"
    result = EmailSender.send_mail(
        "中国好班长订阅内容", HTMLgenerator.generateForSendEmail(newsList), [email])
    return {"result": result}
Ejemplo n.º 5
0
def apiTemp_getNewsByCatalog():
    if request.method == "POST":
        formJson = request.get_json()
        returnJson = newdb.get({"newCatalog": escape(formJson["newCatalog"]) if formJson.has_key("newCatalog") else ''})
        return jsonify(returnJson)