$subject = '服务请求处理完成通知通知【' . $notifications['t_maskid'] . '】';
     $url_ticket_id = $notifications['t_ticketid'];
     $first_data = '您的服务请求已被处理完成。';
     $remark_data = '感谢你对GDS的理解和支持!';
     $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);
        }
    }
    if ($p_method_sms == '1') {
        if ($prefer_mobile == true || $p_stage == 'wo_delay' || $p_stage == 'manual' || $p_stage == 'manual_1') {
            $to_mobile = $p_user_phone;
            $url_ticket_id = $p_ky_ticketid;
            $first_data = $p_first;
            $remark_data = $p_remark;
            if ($p_stage != 'manual_1') {
                $keyword1_data = '服务单号:' . $p_ky_maskid . '(请注意保留)';
            } else {
                $keyword1_data = $keyword2_data = $keyword3_data = $keyword4_data = $keyword5_data = $keyword6_data = $keyword7_data = $keyword8_data = "";
            }
            if (preg_match_all("/(1\\d{10})/", $to_mobile, $to_mobile_ext)) {
                _log('Mobile number [' . $to_mobile . '] extracted to [' . var_export($to_mobile_ext, true) . ']...');
                $result_sms = send_sms_csc($notice_id, $to_mobile_ext[0][0], $url_ticket_id, $first_data, $remark_data, $keyword1_data);
                if ($result_sms != 1) {
                    array_push($error, '向客户发送短信失败');
                } else {
                    array_push($sent, '发送短信成功');
                }
            } else {
                array_push($error, '手机号码无效,或没有客户手机号码信息');
            }
        } else {
            _log('客户设置了不通过【短信】接收【' . $p_stage_text . '】有关的消息');
            array_push($error, '客户设置了不通过【短信】接收【' . $p_stage_text . '】有关的消息');
        }
    }
}
// To ADM