Skip to content

Instantly share code, notes, and snippets.

@jjsty1e
Created March 24, 2023 05:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jjsty1e/282567cf4885dbf2909a4943ab4f0026 to your computer and use it in GitHub Desktop.
Save jjsty1e/282567cf4885dbf2909a4943ab4f0026 to your computer and use it in GitHub Desktop.
禅道bug提醒
<?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