Created
March 24, 2023 05:31
-
-
Save jjsty1e/282567cf4885dbf2909a4943ab4f0026 to your computer and use it in GitHub Desktop.
禅道bug提醒
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
try { | |
// 请求头 | |
$headers = [ | |
'Content-Type: application/json', | |
]; | |
$payload = json_encode([ | |
'msgtype' => 'markdown', | |
'markdown' => [ | |
'content' => "**Hi, {$bug->assignedTo} 您有一个新的bug待查收:** | |
> {$bug->title} | |
点击查看-> [https://zentao.slicejobs.com/bug-view-{$bug->id}.html](https://zentao.slicejobs.com/bug-view-{$bug->id}.html) | |
", | |
] | |
]); | |
$ch = curl_init(); | |
curl_setopt_array($ch, [ | |
CURLOPT_URL => 'https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=xxxxx', | |
CURLOPT_CUSTOMREQUEST => 'POST', | |
CURLOPT_HTTPHEADER => $headers, | |
CURLOPT_HEADER => 0, | |
CURLOPT_RETURNTRANSFER => true, | |
CURLOPT_POSTFIELDS => $payload | |
]); | |
curl_exec($ch); | |
} catch (\Exception $e) {} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment