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 da2e25317a33389e85cf3078f5b03f6b984c318b) +++ b/cleantalk.module (revision 9c5b9d229ce4de5846a2729fb241e00143d29f60) @@ -332,11 +332,13 @@ if ($current_user->id()) { $user = User::load($current_user->id()); $spam_check['sender_nickname'] = !empty($user->get('name')) ? $user->get('name')->value : ''; - } - else { + $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'] : '');