def send_approve_or_reject_email(approved_fs,approve):
    if (len(approved_fs)==0):
        return False
    if validateEmail(approved_fs[0].user.email):
        if (approve):
            text = ""
            if approved_fs[0].user.first_name != "" or approved_fs[0].user.last_name != "":
                text = text + "Hi, %s %s\n\n"%(approved_fs[0].user.first_name,approved_fs[0].user.last_name)
            else:
                text = text + "Hi there:\n\n"
                
            text = text + "Your flowspace requests listed below have been approved.\n"
            text = text + "You may control these flowspaces and opt them in/out of available experiments.\n\n"
            text = text + "Flowspaces:\n"

            for fs in approved_fs:
                if hasattr(fs,"approver"):
                    appr = fs.approver
                elif hasattr(fs,"admin"):
                    appr = fs.admin
                elif hasattr(fs,"user"):
                    appr = fs.user.get_profile().supervisor
                else:
                    return False
                
                if appr.first_name != "" or appr.last_name != "":
                    approver = "%s %s"%(appr.first_name,appr.last_name)
                else:
                    approver = "%s"%appr.username
        
                text = text + "%s\t approved by %s\n"%(fs,approver)
                
            text = text + "\nRegards,\n%s"%SITE_NAME
            return send_mail(approved_fs[0].user.email,"Flowspace Request Approved",text)
        else:
            text = ""
            if approved_fs[0].user.first_name != "" or approved_fs[0].user.last_name != "":
                text = text + "Hi, %s %s\n\n"%(approved_fs[0].user.first_name,approved_fs[0].user.last_name)
            else:
                text = text + "Hi there:\n\n"
                
            text = text + "Your flowspace requests listed below have been rejected by the admin.\n\n"
            text = text + "Flowspaces:\n"
            for fs in approved_fs:
                if hasattr(fs,"approver"):
                    appr = fs.approver
                elif hasattr(fs,"admin"):
                    appr = fs.admin
                elif hasattr(fs,"user"):
                    appr = fs.user.get_profile().supervisor
                else:
                    return False
                
                if appr.first_name != "" or appr.last_name != "":
                    approver = "%s %s"%(appr.first_name,appr.last_name)
                else:
                    approver = "%s"%appr.username
        
                text = text + "%s\t rejected by %s\n"%(fs,approver)
                
            text = text + "\nRegards,\n%s"%SITE_NAME
            return send_mail(approved_fs[0].user.email,"Flowspace Request Rejected",text)
 
    else:
        return False
Sends an e-mail to the user whose flowspace is approved or rejected telling him/her
dataset/ETHPy150Open fp7-ofelia/ocf/optin_manager/src/python/openflow/optin_manager/admin_manager/helper.py/send_approve_or_reject_email