Index: cleantalk.module IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== diff --git a/cleantalk.module b/cleantalk.module --- a/cleantalk.module (revision 497fd014bd1050a7ae21971830fea88391562fc7) +++ b/cleantalk.module (revision 781b51592331c9d8ee8e3c587b450b6e6d06d52a) @@ -288,11 +288,14 @@ if ($current_user->id()) { $user = User::load($current_user->id()); $spam_check['sender_nickname'] = !empty($user->get('name')) ? $user->get('name')->value : ''; + $spam_check['sender_email'] = !empty($user->get('mail')) ? $user->get('mail')->value : ''; } else { $spam_check['sender_nickname'] = ($ct_temp_msg_data['nickname'] ? $ct_temp_msg_data['nickname'] : ''); } - $spam_check['sender_email'] = ($ct_temp_msg_data['email'] ? $ct_temp_msg_data['email'] : ''); + if (empty($spam_check['sender_email'])) { + $spam_check['sender_email'] = ($ct_temp_msg_data['email'] ? $ct_temp_msg_data['email'] : ''); + } $spam_check['message_title'] = ($ct_temp_msg_data['subject'] ? $ct_temp_msg_data['subject'] : ''); $spam_check['message_body'] = ($ct_temp_msg_data['message'] ? $ct_temp_msg_data['message'] : '');