feat(ticket): record urges in thread, show urge count in admin, mail admins
- aksrt_ticket gains urge_count / last_urge_time (schema 3.1.0) - cooldown moves from transient to an atomic conditional UPDATE - urge inserts a system reply rendered as a centered notice (not quotable) - admin list badge + info card row for urge count / last time - new ticket_urge_admin mail event via aksrt_ticket_urged Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
ac3ed9c956
commit
5febdb35c8
14 files changed
+198
-25
No files matched your search
@@ -26,6 +26,28 @@ final class MailNotifications {
|
||||
add_action('aksrt_friend_link_submitted', [self::class, 'friend_link_submitted'], 20, 1);
|
||||
add_action('aksrt_user_phone_changed', [self::class, 'phone_changed'], 20, 2);
|
||||
add_action('aksrt_user_restriction_changed', [self::class, 'restriction_changed'], 20, 4);
|
||||
add_action('aksrt_ticket_urged', [self::class, 'ticket_urged'], 20, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* 催单邮件:已指派跟进人时只发给跟进人,否则发给全部管理员(与站内通知同一路由)。
|
||||
*
|
||||
* @param array<string,mixed> $ticket
|
||||
*/
|
||||
public static function ticket_urged(array $ticket): void {
|
||||
$vars = [
|
||||
'username' => (string) ($ticket['user_name'] ?? ''),
|
||||
'count' => (int) ($ticket['urge_count'] ?? 0),
|
||||
'ticket_num' => (string) ($ticket['ticket_num'] ?? ''),
|
||||
'title' => (string) ($ticket['title'] ?? ''),
|
||||
'url' => admin_url('users.php?page=aksrt_tickets&id=' . (int) ($ticket['id'] ?? 0)),
|
||||
];
|
||||
$assignee = get_userdata((int) ($ticket['admin_id'] ?? 0));
|
||||
if ($assignee instanceof \WP_User && is_email($assignee->user_email)) {
|
||||
self::send('ticket_urge_admin', $assignee->user_email, $vars);
|
||||
return;
|
||||
}
|
||||
self::send_admin('ticket_urge_admin', $vars);
|
||||
}
|
||||
|
||||
public static function restriction_changed(int $user_id, string $type, string $action, string $reason): void {
|
||||
|
||||
Reference in new issue
Block a user