Skip to content

Commit 6546c81

Browse files
committed
Log test email as string
1 parent 7de7e3a commit 6546c81

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

plugins/bcc-login/includes/class-bcc-coreapi-client.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@ public function send_notification($group_uids, $type, $workflow, $payload, $test
357357

358358
if ($test_person_uid) {
359359
error_log('TEST SEND - POST ' . $request_url);
360-
error_log('TEST SEND - Request body: ' . json_encode($request_body, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE));
360+
error_log('TEST SEND - Request body: ' . json_encode($request_body, JSON_UNESCAPED_UNICODE));
361361
}
362362

363363
$response = wp_remote_post($request_url, array(

plugins/bcc-login/includes/class-bcc-notifications.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,10 @@ public function send_notification($post_id, $test_person_uid = null) {
230230

231231
// Skip if the template has no meaningful content configured
232232
$has_content = !empty($templates["email_title"]) || !empty($templates["email_body"]);
233+
if ($test_person_uid) {
234+
error_log('TEST SEND - Templates for locale "' . $wp_lang . '": ' . json_encode($templates, JSON_UNESCAPED_UNICODE));
235+
error_log('TEST SEND - has_content: ' . ($has_content ? 'true' : 'false'));
236+
}
233237
if (!$has_content) {
234238
error_log('DEBUG: ' . __METHOD__ . ' - Skipping email payload for ' . $wp_lang . ': template has no title or body configured.');
235239
} else {
@@ -256,6 +260,9 @@ public function send_notification($post_id, $test_person_uid = null) {
256260
}
257261

258262
error_log('DEBUG: ' . __METHOD__ . ' - Sending notifications for ' . count($email_payload) . ' languages.');
263+
if ($test_person_uid) {
264+
error_log('TEST SEND - Full email payload (' . count($email_payload) . ' items): ' . json_encode($email_payload, JSON_UNESCAPED_UNICODE));
265+
}
259266

260267
// Send notifications to target groups
261268
if ($send_email_to_target_groups) {

0 commit comments

Comments
 (0)