Example #1
0
function mc_notice_custom_text($openid, $title, $info)
{
    global $_W;
    $acc = mc_notice_init();
    if (is_error($acc)) {
        return error(-1, $acc['message']);
    }
    $custom = array('msgtype' => 'text', 'text' => array('content' => urlencode($title . '\\n' . $info)), 'touser' => $openid);
    $status = $acc->sendCustomNotice($custom);
    return $status;
}
Example #2
0
function mc_notice_custom_text($info, $openid = '')
{
    global $_W;
    $acc = mc_notice_init();
    if (is_error($acc)) {
        return error(-1, $acc['message']);
    }
    $openid = trim($openid);
    if (empty($openid)) {
        $openid = trim($_W['openid']);
    }
    if (empty($openid)) {
        return error(-1, '粉丝openid错误');
    }
    $custom = array('msgtype' => 'text', 'text' => array('content' => urlencode($info)), 'touser' => $openid);
    $status = $acc->sendCustomNotice($custom);
    return $status;
}