예제 #1
0
파일: main.py 프로젝트: junnf/warnsys
    def post(self):
        '''
        {
          name:
          email:
          mobi:
          }

        '''
        _cond = self.get_argument('cond')
        _cond_des = self.get_argument('cond_des')
        coll = self.application.db['member']
        for _tem_meb in coll.find():
          #notify email
            _phone = str(_tem_meb['mobi'])
            _pos_par = sendemail.get_params(emailto = str(_tem_meb['email']),
                emailfrom = '*****@*****.**',
                fromname = 'AlertCenter',
                subject = _cond,
                content = _cond_des 
                )
            sendemail.sendemail(sendemail.url,_pos_par)
         # notify mobi
            #_cond 
            #_cond_des

            _str_v = '{"%user_name%":' + '"' + str(_cond) + '","%alert_content%":"' + str(_cond_des) + '"}'
           # _str_v = '{"%user_name%":"%s","%alert_content%":"%s"}' % (_cond,_cond_des)
            
            response = sendmessage.sendmess(_str_v, _phone)
            self.write(response)
예제 #2
0
def test_danger():
    db = Db() 
    member0 = db.membersmall5(0)
    member1 = db.membersmall5(1)
    for y in member0: 
        sendemail.get_params(emailto = str(x['email'])),
        emailfrom = '*****@*****.**',
        fromname = 'DataCenter',
        subject = '请修改条件,修改职位描述'
        content = x['name']+'你好: 你的职位推荐有问题,请修改'
    
    for x in member1:
        sendemail.get_params(emailto = str(x['email'])),
        emailfrom = '*****@*****.**',
        fromname = 'DataCenter',
        subject = '请修改条件,修改职位描述'
        content = x['name']+'你好: 你的职位推荐有问题,请修改' 
   
    member2 = db.memberx3d5()