From 4e0ff046b464f1220945dfe4c7844ad5099b03c9 Mon Sep 17 00:00:00 2001 From: Leo Q Date: Fri, 24 Nov 2023 14:39:43 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A1=A5=E5=85=85=E9=81=97=E6=BC=8F=E7=9A=84?= =?UTF-8?q?=E4=BC=81=E4=B8=9A=E5=BE=AE=E4=BF=A1=E8=87=AA=E5=BB=BA=E5=BA=94?= =?UTF-8?q?=E7=94=A8=E7=9A=84=E9=80=9A=E7=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sql/notify.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/sql/notify.py b/sql/notify.py index 92c2a56d88..ecb5ad73e3 100755 --- a/sql/notify.py +++ b/sql/notify.py @@ -448,6 +448,22 @@ def send(self): ) +class QywxToUserNotifier(LegacyRender): + name = "qywx_to_user" + sys_config_key: str = "wx" + + def send(self): + msg_sender = MsgSender() + for m in self.messages: + msg_to_wx_user = [ + user.wx_user_id if user.wx_user_id else user.username + for user in chain(m.msg_to, m.msg_cc) + ] + msg_sender.send_wx2user( + f"{msg_title}\n{msg_content}", msg_to_wx_user + ) + + class MailNotifier(LegacyRender): name = "mail" sys_config_key = "mail"