fix(email): complete mail settings and templates

This commit is contained in:
2026-09-04 12:06:42 +08:00
parent 4f8ab94fac
commit 4833053a5c
29 changed files with 716 additions and 426 deletions
+3 -1
View File
@@ -103,7 +103,9 @@ class Message {
if ($inserted === false) return false;
// 触发通知钩子
do_action('aksrt_notification_sent', $to_user_id, $type, $data);
do_action('aksrt_notification_sent', $to_user_id, $type, array_merge($data, [
'description' => $content,
]));
return true;
}
+15 -2
View File
@@ -50,7 +50,17 @@ class ReportCenter {
'created_at' => current_time('mysql'),
], ['%d', '%s', '%d', '%s', '%s', '%s', '%s']);
return $wpdb->insert_id ? (int) $wpdb->insert_id : 0;
$id = $wpdb->insert_id ? (int) $wpdb->insert_id : 0;
if ($id > 0) {
do_action('aksrt_report_submitted', $id, [
'reporter_id' => $reporter_id,
'target_type' => $target_type,
'target_id' => $target_id,
'reason' => $reason,
'category' => $category,
]);
}
return $id;
}
/**
@@ -118,7 +128,7 @@ class ReportCenter {
global $wpdb;
$existing = $wpdb->get_row($wpdb->prepare(
"SELECT id, notes_json FROM {$table} WHERE id = %d",
"SELECT id, reporter_id, notes_json FROM {$table} WHERE id = %d",
$report_id
));
@@ -143,6 +153,9 @@ class ReportCenter {
}
$result = $wpdb->update($table, $update_data, ['id' => $report_id], $format, ['%d']);
if ($result !== false) {
do_action('aksrt_report_status_changed', $report_id, (int) ($existing->reporter_id ?? 0), $new_status);
}
return $result !== false;
}