73 lines
1.7 KiB
PHP
73 lines
1.7 KiB
PHP
<?php
|
|
|
|
|
|
namespace app\admin\controller;
|
|
|
|
|
|
class SendMailLogic
|
|
{
|
|
|
|
|
|
/**
|
|
* 给工人发送开始前短信
|
|
* @param $tel
|
|
* @return bool
|
|
*/
|
|
public static function sendToWorker($toTel)
|
|
{
|
|
$config = get_addon_config('alisms');
|
|
if (!isset($config['template']['start_worker'])) {
|
|
return false;
|
|
}
|
|
$alisms = new \addons\alisms\library\Alisms();
|
|
$result = $alisms->mobile($toTel)
|
|
->template($config['template']['start_worker'])
|
|
->param([])
|
|
->send();
|
|
return $result;
|
|
}
|
|
|
|
/**
|
|
* 给客户接单的信息
|
|
* @param $tel
|
|
* @return bool
|
|
*/
|
|
public static function sendToCustomStart($toTel,$work_name,$work_tel)
|
|
{
|
|
$config = get_addon_config('alisms');
|
|
if (!isset($config['template']['start_custom'])) {
|
|
return false;
|
|
}
|
|
$alisms = new \addons\alisms\library\Alisms();
|
|
$result = $alisms->mobile($toTel)
|
|
->template($config['template']['start_custom'])
|
|
->param([
|
|
'name' => $work_name,
|
|
'phone' => $work_tel
|
|
])
|
|
->send();
|
|
return $result;
|
|
}
|
|
|
|
|
|
/**
|
|
* 给客户取消订单的信息
|
|
* @param $tel
|
|
* @return bool
|
|
*/
|
|
public static function sendToCustomStop($toTel)
|
|
{
|
|
$config = get_addon_config('alisms');
|
|
if (!isset($config['template']['stop_custom'])) {
|
|
return false;
|
|
}
|
|
$alisms = new \addons\alisms\library\Alisms();
|
|
$result = $alisms->mobile($toTel)
|
|
->template($config['template']['stop_custom'])
|
|
->param()
|
|
->send();
|
|
return $result;
|
|
}
|
|
|
|
|
|
} |