示例#1
0
def _send_email_to_user(
        appname, projectname, module, uid, submit_uid, id, mark):
    user_info = User.find_one(
        appname, {"_id": submit_uid}, {"user_name": 1, "_id": 0})
    subject = u"Check result"
    template = os.path.join(TEMPLATE_ROOT, "check_info.html")
    mail_to = [user_info.get("user_name")]
    from_to = User.find_one(
        appname, {"_id": uid}, {"user_name": 1}).get("user_name")
    mail_to.append("*****@*****.**")
    module = get_module_value(appname, projectname, module)
    projectname = get_project_value(projectname)
    send_email(
        subject, template, mail_to, from_to, projectname, module, id, mark)
示例#2
0
def _send_email_to_assessor(appname, projectname, module, uid, uids, ids):
    subject = u"Submit check list"
    from_info = User.find_one(appname, {"_id": uid}, {"user_name": 1})
    from_to = from_info.get("user_name")
    mail_to = []
    for uid in uids:
        user_info = User.find_one(
            appname, {"_id": uid}, {"user_name": 1, "_id": 0})
        mail_to.append(user_info.get("user_name"))
    mail_to.append("*****@*****.**")
    template = os.path.join(TEMPLATE_ROOT, "submit_checklist.html")
    module = get_module_value(appname, projectname, module)
    projectname = get_project_value(projectname)
    send_email(subject, template, mail_to, from_to, projectname, module, ids)