no message

This commit is contained in:
hellcat 2025-12-30 18:57:14 +08:00
parent c490b7dde0
commit c882583d57
8 changed files with 109 additions and 109 deletions

View File

@ -96,7 +96,7 @@ final class TicketController extends BaseController
Notification::notifyUser(
$user,
$_ENV['appName'] . '-工单被回复',
$_ENV['appName'] . ' - 工单被回复',
'你好,有人回复了<a href="' . $_ENV['baseUrl'] . '/user/ticket/' . $ticket->id . '/detail">工单</a>。<br><br>回复内容:'.$comment
);
@ -144,7 +144,7 @@ final class TicketController extends BaseController
Notification::notifyUser(
$user,
$_ENV['appName'] . '-工单被回复',
$_ENV['appName'] . ' - 工单被回复',
'你好AI 回复了<a href="' . $_ENV['baseUrl'] . '/user/ticket/' . $ticket->id . '/view">工单</a>,请你查看。'
);

View File

@ -207,7 +207,7 @@ final class AuthController extends BaseController
try {
Mail::send(
$email,
$_ENV['appName'] . '- 验证邮件',
$_ENV['appName'] . ' - 验证邮件',
'verify_code.tpl',
[
'code' => $email_code,

View File

@ -64,7 +64,7 @@ final class LoginIp extends Model
try {
Notification::notifyUser(
(new User())->where('id', $user_id)->first(),
$_ENV['appName'] . '-新登录通知',
$_ENV['appName'] . ' - 新登录通知',
'你的账号于 ' . date('Y-m-d H:i:s') . ' 通过 ' . $this->ip . ' 地址登录了用户面板',
);
} catch (GuzzleException|ClientExceptionInterface|TelegramSDKException $e) {

View File

@ -67,7 +67,7 @@ final class SubscribeLog extends Model
try {
Notification::notifyUser(
$user,
$_ENV['appName'] . '-新订阅通知',
$_ENV['appName'] . ' - 新订阅通知',
'你的账号于 ' . date('Y-m-d H:i:s') . ' 通过 ' . $this->request_ip . ' 地址订阅了新的节点',
);
} catch (GuzzleException|ClientExceptionInterface|TelegramSDKException $e) {

View File

@ -408,28 +408,28 @@ final class Cron
if ($node->getNodeOnlineStatus() === -1 && $node->online === 1) {
echo 'Send Node Offline Email to admin users' . PHP_EOL;
try {
Notification::notifyAdmin(
$_ENV['appName'] . '-系统警告',
'管理员你好,系统发现节点 ' . $node->name . ' 掉线了,请你及时处理。'
);
} catch (GuzzleException|ClientExceptionInterface|TelegramSDKException $e) {
echo $e->getMessage() . PHP_EOL;
}
if (Config::obtain('telegram_node_offline')) {
$notice_text = str_replace(
'%node_name%',
$node->name,
Config::obtain('telegram_node_offline_text')
);
try {
(new Telegram())->send(0, $notice_text);
} catch (TelegramSDKException $e) {
echo $e->getMessage();
}
}
// try {
// Notification::notifyAdmin(
// $_ENV['appName'] . '-系统警告',
// '管理员你好,系统发现节点 ' . $node->name . ' 掉线了,请你及时处理。'
// );
// } catch (GuzzleException|ClientExceptionInterface|TelegramSDKException $e) {
// echo $e->getMessage() . PHP_EOL;
// }
//
// if (Config::obtain('telegram_node_offline')) {
// $notice_text = str_replace(
// '%node_name%',
// $node->name,
// Config::obtain('telegram_node_offline_text')
// );
//
// try {
// (new Telegram())->send(0, $notice_text);
// } catch (TelegramSDKException $e) {
// echo $e->getMessage();
// }
// }
$node->online = 0;
$node->save();
@ -440,28 +440,28 @@ final class Cron
if ($node->getNodeOnlineStatus() === 1 && $node->online === 0) {
echo 'Send Node Online Email to admin user' . PHP_EOL;
try {
Notification::notifyAdmin(
$_ENV['appName'] . '-系统提示',
'管理员你好,系统发现节点 ' . $node->name . ' 恢复上线了。'
);
} catch (GuzzleException|ClientExceptionInterface|TelegramSDKException $e) {
echo $e->getMessage() . PHP_EOL;
}
// try {
// Notification::notifyAdmin(
// $_ENV['appName'] . '-系统提示',
// '管理员你好,系统发现节点 ' . $node->name . ' 恢复上线了。'
// );
// } catch (GuzzleException|ClientExceptionInterface|TelegramSDKException $e) {
// echo $e->getMessage() . PHP_EOL;
// }
if (Config::obtain('telegram_node_online')) {
$notice_text = str_replace(
'%node_name%',
$node->name,
Config::obtain('telegram_node_online_text')
);
try {
(new Telegram())->send(0, $notice_text);
} catch (TelegramSDKException $e) {
echo $e->getMessage();
}
}
// if (Config::obtain('telegram_node_online')) {
// $notice_text = str_replace(
// '%node_name%',
// $node->name,
// Config::obtain('telegram_node_online_text')
// );
//
// try {
// (new Telegram())->send(0, $notice_text);
// } catch (TelegramSDKException $e) {
// echo $e->getMessage();
// }
// }
$node->online = 1;
$node->save();
@ -519,7 +519,7 @@ final class Cron
// 这里返水的话,等于是直接覆盖的用户不返水,自然过期的用户返水,这到合理,自然过期的才是好用户
try {
Notification::notifyUser($user, $_ENV['appName'] . '-您的套餐已经过期', $text);
Notification::notifyUser($user, $_ENV['appName'] . ' - 您的套餐已经过期', $text);
} catch (GuzzleException|ClientExceptionInterface|TelegramSDKException $e) {
echo $e->getMessage() . PHP_EOL;
}
@ -1367,7 +1367,7 @@ final class Cron
$oUser->class_expire = $iToExpire;
$oUser->save();
Notification::notifyUser($oUser, $_ENV['appName'] . '-您的套餐已经过期', $text);
Notification::notifyUser($oUser, $_ENV['appName'] . ' - 您的套餐已经过期', $text);
// try {
// Notification::notifyUser($oUser, $_ENV['appName'] . '-您的套餐已经过期', $text);
@ -1917,7 +1917,7 @@ final class Cron
try {
Notification::notifyUser(
$user,
$_ENV['appName'] . '-你的剩余流量过低',
$_ENV['appName'] . ' - 你的剩余流量过低',
'你好,系统发现你剩余流量已经低于 ' . $_ENV['notify_limit_value'] . $unit_text . ' 。',
);

View File

@ -324,28 +324,28 @@ final class Cron
if ($node->getNodeOnlineStatus() === 1 && $node->online === 0) {
echo 'Send Node Online Email to admin user' . PHP_EOL;
try {
Notification::notifyAdmin(
$_ENV['appName'] . '-系统提示',
'管理员你好,系统发现节点 ' . $node->name . ' 恢复上线了。'
);
} catch (GuzzleException|ClientExceptionInterface|TelegramSDKException $e) {
echo $e->getMessage() . PHP_EOL;
}
// try {
// Notification::notifyAdmin(
// $_ENV['appName'] . ' - 系统提示',
// '管理员你好,系统发现节点 ' . $node->name . ' 恢复上线了。'
// );
// } catch (GuzzleException|ClientExceptionInterface|TelegramSDKException $e) {
// echo $e->getMessage() . PHP_EOL;
// }
if (Config::obtain('telegram_node_online')) {
$notice_text = str_replace(
'%node_name%',
$node->name,
Config::obtain('telegram_node_online_text')
);
try {
(new Telegram())->send(0, $notice_text);
} catch (TelegramSDKException $e) {
echo $e->getMessage();
}
}
// if (Config::obtain('telegram_node_online')) {
// $notice_text = str_replace(
// '%node_name%',
// $node->name,
// Config::obtain('telegram_node_online_text')
// );
//
// try {
// (new Telegram())->send(0, $notice_text);
// } catch (TelegramSDKException $e) {
// echo $e->getMessage();
// }
// }
$node->online = 1;
$node->save();

View File

@ -51,24 +51,24 @@ final class Detect
echo '检测到节点 #' . $node->id . ' 被 GFW 封锁' . PHP_EOL;
echo 'Send gfw mail to admin' . PHP_EOL;
try {
Notification::notifyAdmin(
$_ENV['appName'] . '-系统警告',
'管理员你好,系统发现节点 ' . $node->name . ' 被墙了。'
);
} catch (GuzzleException|ClientExceptionInterface|TelegramSDKException $e) {
echo $e->getMessage() . PHP_EOL;
}
if (Config::obtain('telegram_node_gfwed')) {
$notice_text = str_replace(
'%node_name%',
$node->name,
Config::obtain('telegram_node_gfwed_text')
);
(new Telegram())->send(0, $notice_text);
}
// try {
// Notification::notifyAdmin(
// $_ENV['appName'] . '-系统警告',
// '管理员你好,系统发现节点 ' . $node->name . ' 被墙了。'
// );
// } catch (GuzzleException|ClientExceptionInterface|TelegramSDKException $e) {
// echo $e->getMessage() . PHP_EOL;
// }
//
// if (Config::obtain('telegram_node_gfwed')) {
// $notice_text = str_replace(
// '%node_name%',
// $node->name,
// Config::obtain('telegram_node_gfwed_text')
// );
//
// (new Telegram())->send(0, $notice_text);
// }
$node->gfw_block = true;
$node->save();
@ -80,24 +80,24 @@ final class Detect
echo '检测到节点 #' . $node->id . ' 被 GFW 解除封锁' . PHP_EOL;
echo 'Send gfw mail to admin' . PHP_EOL;
try {
Notification::notifyAdmin(
$_ENV['appName'] . '-系统提示',
'管理员你好,系统发现节点 ' . $node->name . ' 溜出墙了。'
);
} catch (GuzzleException|ClientExceptionInterface|TelegramSDKException $e) {
echo $e->getMessage() . PHP_EOL;
}
if (Config::obtain('telegram_node_ungfwed')) {
$notice_text = str_replace(
'%node_name%',
$node->name,
Config::obtain('telegram_node_ungfwed_text')
);
(new Telegram())->send(0, $notice_text);
}
// try {
// Notification::notifyAdmin(
// $_ENV['appName'] . '-系统提示',
// '管理员你好,系统发现节点 ' . $node->name . ' 溜出墙了。'
// );
// } catch (GuzzleException|ClientExceptionInterface|TelegramSDKException $e) {
// echo $e->getMessage() . PHP_EOL;
// }
//
// if (Config::obtain('telegram_node_ungfwed')) {
// $notice_text = str_replace(
// '%node_name%',
// $node->name,
// Config::obtain('telegram_node_ungfwed_text')
// );
//
// (new Telegram())->send(0, $notice_text);
// }
$node->gfw_block = false;
$node->save();

View File

@ -22,7 +22,7 @@ final class Password
$redis->setex('password_reset:' . $token, Config::obtain('email_password_reset_ttl'), $email);
$subject = $_ENV['appName'] . '-重置密码';
$subject = $_ENV['appName'] . ' - 重置密码';
$resetUrl = $_ENV['baseUrl'] . '/password/token/' . $token;
Mail::send(