调整询单提醒为邮件

This commit is contained in:
mzl
2025-10-13 14:13:08 +08:00
parent 04d7d73c45
commit ae5a415b38
6 changed files with 230 additions and 234 deletions
+21 -6
View File
@@ -75,6 +75,16 @@ class InquiryToCrmNew implements Consumer
\Webman\RedisQueue\Redis::send('notice', $wsdata);
}
public function pushEmail($id, $title, $email)
{
$options = [
'id' => $id,
'email' => $email,
'title' => $title,
];
\Webman\RedisQueue\Redis::send('email-message', $options);
}
public function syncCustomer(Model $info)
{
$uInfo = $this->recipientInfo($info);
@@ -87,25 +97,28 @@ class InquiryToCrmNew implements Consumer
$title = '[询单·分配] 新的客户线索【' . $info->order_no . '】,请及时处理';
$content = '[询单·分配] 新的客户线索【' . $info->order_no . '】,请及时处理';
$recipient = [$info->recipient];
$this->pushWs($title, $content, $recipient);
// $this->pushWs($title, $content, $recipient);
$this->pushEmail($info->id, $title, $uInfo['uinfo']['email']);
} else {
if ($info->status == 2 && $crmCustomerInfo->user_id == $info->recipient) {
// $notice = '更新';
$title = '[询单·更新] 客户线索' . $info->order_no . '有新的调整,请及时处理';
$content = '[询单·更新] 客户线索' . $info->order_no . '有新的调整,请及时处理';
$recipient = [$info->recipient];
$this->pushWs($title, $content, $recipient);
// $this->pushWs($title, $content, $recipient);
$this->pushEmail($info->id, $title, $uInfo['uinfo']['email']);
} else {
// $notice = '重新分配';
$title = '[询单·分配] 新的客户线索【' . $info->order_no . '】,请及时处理';
$content = '[询单·分配] 新的客户线索【' . $info->order_no . '】,请及时处理';
$recipient = [$info->recipient];
$this->pushWs($title, $content, $recipient);
// $this->pushWs($title, $content, $recipient);
$this->pushEmail($info->id, $title, $uInfo['uinfo']['email']);
}
}
$udata = [
'corp_id' => $uInfo['corpId'],
'corp_id' => $uInfo['corpId'],
'user_id' => $info->recipient,
'channel_id' => $info->channel,
'country_id' => $info->country,
@@ -151,7 +164,8 @@ class InquiryToCrmNew implements Consumer
$title = '[询单·公海] 新的客户线索【' . $info->order_no . '】发布';
$content = '[询单·公海] 新的客户线索【' . $info->order_no . '】发布';
$recipient = [$info->recipient];
$this->pushWs($title, $content);
// $this->pushWs($title, $content);
$this->pushEmail($info->id, $title, $uInfo['uinfo']['email']);
}
if ($info->status == 2) {
@@ -159,7 +173,8 @@ class InquiryToCrmNew implements Consumer
$title = '[询单·分配] 新的客户线索【' . $info->order_no . '】,请及时处理';
$content = '[询单·分配] 新的客户线索【' . $info->order_no . '】,请及时处理';
$recipient = [$info->recipient];
$this->pushWs($title, $content, $recipient);
// $this->pushWs($title, $content, $recipient);
$this->pushEmail($info->id, $title, $uInfo['uinfo']['email']);
}
}
return true;