Пример #1
0
         }
     } else {
         _log('No openid binded for CUSTOMER ' . $notifications['t_custmail'] . '...');
     }
 }
 if ($prefer_email) {
     $to_addr = $notifications['t_custmail'];
     $to_name = $notifications['t_custname'];
     $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';
Пример #2
0
<?php

function send_mail_csc($to_addr, $to_name, $subject, $url_ticket_id, $first_data, $remark_data, $keyword1_data, $keyword2_data, $keyword3_data = null)
{
    $boundary = str_replace(" ", "", date('l jS \\of F Y h i s A'));
    $headers = 'MIME-Version: 1.0' . PHP_EOL . 'From: noreply <*****@*****.**>' . PHP_EOL . 'Reply-To: noreply <*****@*****.**>' . PHP_EOL . 'Cc: chenjun@gds-services.com' . PHP_EOL . 'BCc: linpeijie@gds-services.com' . PHP_EOL . 'Content-Type: multipart/alternative; boundary=\\"' . $boundary . '\\"--' . $boundary . PHP_EOL . 'Content-Type: text/html; charset=utf-8' . PHP_EOL . 'Content-Transfer-Encoding: base64' . PHP_EOL;
    $params = '-r noreply@gds-services.com';
    $font = 'font-family: "PingFang SC", "Microsoft Yahei", DengXian, SimSum; font-size: 14px;';
    $url = 'https://wechat.gds-services.com/static/html/query_req_detail.html?tid=' . $url_ticket_id . '&spkey=' . rand(10000, 30000) . '' . rand(10000, 30000);
    $message = '<!DOCTYPE html>' . '<html lang="zh-CN">' . '<head>' . '    <meta charset="utf-8">' . '    <meta name="apple-mobile-web-app-capable" content="yes">' . '    <meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no">' . '    <title>' . $subject . '</title>' . '</head>' . '<body>' . '    <p style=\'' . $font . '\'>' . $to_name . ',您好!<br></p>' . '    <p style=\'' . $font . '\'>' . $first_data . '</p>' . '    <ul>' . '        <li style=\'' . $font . '\'>' . $keyword1_data . '</li>' . '        <li style=\'' . $font . '\'>' . $keyword2_data . '</li>' . (!empty($keyword3_data) && $keyword3_data != null ? '<li style=\'' . $font . '\'>' . $keyword3_data . '</li>' : '') . '    </ul>' . '    <p style=\'' . $font . '\'>' . $remark_data . '</p>' . '    <p style=\'' . $font . '\'>顺颂商祺</p>' . '    <p style=\'' . $font . '\'>&nbsp;</p>' . '    <p style=\'' . $font . '\'>' . '        <span style=\'' . $font . '\'>GDS客户支持中心</span><br>' . '        <span style=\'' . $font . '\'>网站:</span><a style=\'' . $font . '\' target="_blank" href="https://support.gds-services.com">https://support.gds-services.com</a><br>' . '        <span style=\'' . $font . '\'>邮箱:</span><a style=\'' . $font . '\' target="_blank" href="mailto:support@gds-services.com">support@gds-services.com</a><br>' . '        <span style=\'' . $font . '\'>热线:</span><a style=\'' . $font . '\' target="_blank" href="tel:4000-724-366">4000-724-366</a><br>' . '        <span style=\'' . $font . '\'>微信:gdscscwechat 或 GDS客户服务中心</span>' . '    </p>' . '</body>' . '</html>';
    $target_base64 = '=?UTF-8?B?' . base64_encode($to_addr) . '?=';
    $subject_base64 = '=?UTF-8?B?' . base64_encode($subject) . '?=';
    $message_base64 = rtrim(chunk_split(base64_encode($message)));
    return mail($to_addr, $subject_base64, $message_base64, $headers, $params);
}
var_dump(send_mail_csc('*****@*****.**', '韩铠', '邮件标题乱码问题测试', 1111, '您好,这是一封由系统发送的邮件,请测试是否标题依旧乱码?', '感谢你的理解和支持', 'ABCDE', 'あいうえを', '一二三四五'));
var_dump(send_mail_csc('*****@*****.**', '袁晓燕', '邮件标题乱码问题测试', 1111, '您好,这是一封由系统发送的邮件,请测试是否标题依旧乱码?', '感谢你的理解和支持', 'ABCDE', 'あいうえを', '一二三四五'));
//var_dump(send_mail_csc('*****@*****.**', '林培杰', '邮件标题乱码问题测试', 1111, '您好,这是一封由系统发送的邮件,请测试是否标题依旧乱码?', '感谢你的理解和支持', 'ABCDE', 'あいうえを', '一二三四五'));