当前位置:网站首页>Odoo project sends information to wechat official account or enterprise wechat

Odoo project sends information to wechat official account or enterprise wechat

2022-06-23 08:03:00 Mysterious world

odoo client.message.send_text

odoo Send information to wechat

stay odoo When developing projects on the platform, it is sometimes necessary to connect with other platforms to send information .
Here I write one odoo Examples of sending information to enterprise wechat .
You can leave a message if you have any questions !

  • corpID: Enterprises in wechat official account ID

  • agentId : First, in the WeChat official account - application - Create an Create application under , After creation, it will display agentId

  • secret: First, in the WeChat official account - application - Create an Create application under , After creation, it will display secret

  • numbers: numbers Select the personnel account string data to be sent ; Example —— ‘Quan|XiaoXin’, For more than one person, you can use “|” Split splice

      @api.multi
      def send_activity_meg(self):
      
          numbers = [re.wx_number + '|' for re in self.registration_ids]
          #  Here are three data for obtaining wechat official account 
          corpID = 'wwd0fa7b2d99da5810'
          agentId = '1000003'
          secret = 'I3NLAkheWsBLZdAc-akf24-iGthbknmwgVntV4XESHw'
          client = WeChatClient(
              corpID,
              secret
          )
          client.message.send_text(agentId, numbers, ' Here is the information data to be sent ')
    
原网站

版权声明
本文为[Mysterious world]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/174/202206230737045471.html