コード例 #1
0
     $keyword1_data = '服务单号:' . $notifications['t_maskid'];
     $keyword2_data = '处理人:' . $notifications['DCS'];
     $keyword3_data = '完成时间:' . $notifications['n_create_ts'];
     $result_mail = send_mail_csc($notifications['notice_id'], $to_addr, $to_name, $subject, $url_ticket_id, $first_data, $remark_data, $keyword1_data, $keyword2_data, $keyword3_data);
 }
 if ($prefer_mobile) {
     $to_mobile = $notifications['t_custphone'];
     $url_ticket_id = $notifications['t_ticketid'];
     $first_data = '您的服务请求已被处理完成!';
     $remark_data = '感谢你对GDS的理解和支持!';
     $keyword1_data = '服务单号:' . $notifications['t_maskid'];
     $result_sms = send_sms_csc($notifications['notice_id'], $to_mobile, $url_ticket_id, $first_data, $remark_data, $keyword1_data);
 }
 // To ADM
 _log('Processing ADM notification...');
 list($prefer_wechat, $prefer_email, $prefer_mobile) = get_notice_prefer_adm($notifications['ADM_email'], $ticket_stage);
 _log('ADM prefer... ' . json_encode(['ticket_id' => $notifications['t_ticketid'], 'ticket_stage' => $ticket_stage, 'ADM' => $notifications['ADM_email'], 'wechat' => $prefer_wechat, 'email' => $prefer_email, 'mobile' => $prefer_mobile]));
 if ($prefer_wechat) {
     $template_id = 'OFBb_0E6Zy5diGu-ofzsmynT0uySj6-PCU7dPv4sm6o';
     $first_data = '您的客户【' . $notifications['t_custorgname'] . '】的服务请求已被处理完结';
     $remark_data = '请点击详情查看具体信息';
     $keyword1_data = $notifications['t_maskid'];
     $keyword2_data = $notifications['n_create_ts'];
     $openids = get_pe_wechat($notifications['ADM_email']);
     if (!empty($openids)) {
         foreach ($openids as $user_openid) {
             $result_wechat = send_wechat_msg_pe($notifications['notice_id'], $user_openid, 'adm', $template_id, $notifications['t_ticketid'], $first_data, $remark_data, $keyword1_data, $keyword2_data);
         }
     } else {
         _log('No openid binded for ADM ' . $notifications['ADM_email'] . '...');
     }
コード例 #2
0
                } else {
                    array_push($sent, '发送短信成功');
                }
            } else {
                array_push($error, '手机号码无效,或没有客户手机号码信息');
            }
        } else {
            _log('客户设置了不通过【短信】接收【' . $p_stage_text . '】有关的消息');
            array_push($error, '客户设置了不通过【短信】接收【' . $p_stage_text . '】有关的消息');
        }
    }
}
// To ADM
if ($p_user_type == 'adm') {
    _log('Processing ADM notification...');
    list($prefer_wechat, $prefer_email, $prefer_mobile) = get_notice_prefer_adm($p_user_mail, $p_stage_val);
    _log('ADM prefer... ' . json_encode(['ticket_id' => $p_ky_ticketid, 'ticket_stage' => $p_stage_val, 'ADM' => $p_user_mail, 'wechat' => $prefer_wechat, 'email' => $prefer_email, 'mobile' => $prefer_mobile]));
    if ($p_method_wechat == '1') {
        if ($prefer_wechat == true || $p_stage == 'wo_delay' || $p_stage == 'manual' || $p_stage == 'manual_1') {
            $template_id = 'nbebyqwxlPD6QdICK7Z6Di8dV7-HyTbSGGzrk-Mvd4A';
            $first_data = $p_stage != 'manual_1' ? $p_first . "\n\n单号:" . $p_ky_maskid : "";
            $remark_data = ($p_stage != 'manual_1' ? "客户:" . $p_cust_org . "\n联系人:" . $p_cust_name . "\nCSC:" . $p_csc_name . "\nADM:" . $p_adm_name . "\nDCS:" . $p_dcs_name . "\n" : $p_first) . "\n" . $p_remark . "\n";
            $keyword1_data = $p_stage != 'manual_1' ? $p_title : '平台通知';
            $keyword2_data = $p_date;
            $openids = get_pe_wechat($p_user_mail);
            _log('Open ids for ADM are ' . var_export($openids, true));
            if (!empty($openids)) {
                foreach ($openids as $user_openid) {
                    $result_wechat = send_wechat_msg_pe($notice_id, $user_openid, 'adm', $template_id, $p_ky_ticketid, $first_data, $remark_data, $keyword1_data, $keyword2_data);
                    if ($result_wechat != 1) {
                        array_push($error, '向ADM发送微信失败');