小程序推送服务消息
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
public static function send($openid, $template_id, $page, $form_id, $data, $type)
{
$app = Factory::miniProgram(self::miniconfig($type));
$result = $app->uniform_message->send([
'touser' => $openid,
'weapp_template_msg' => [
'template_id' => $template_id,
'page' => $page,
'form_id' => $form_id,
'data' => $data,
'emphasis_keyword' => '',
],
'mp_template_msg' => [
'appid' => self::$config['app_id'],
'template_id' => $template_id,
'url' => $page,
'miniprogram' => ['appid'=>'','pagepath'=>'index.php'],
'data' => $data,
],
]);
return $result;
}
weapp_template_msg服务号 mp_template_msg小程序 两个都传优先小程序