Skip to content

Commit 0ec9e06

Browse files
committed
[BUGFIX] Do not require receiver mail when receiver subject is empty
This fixes the flash message showing "Error, Mail could not sent correctly!" when the receiver subject and the receiver mail is empty. Resolves: in2code-de#611 Obsoletes: in2code-de#612
1 parent 698f28f commit 0ec9e06

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Classes/Domain/Service/Mail/SendMailService.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,14 +87,14 @@ public function sendMail(array $email, Mail $mail, array $settings, string $type
8787
$logger = ObjectUtility::getLogger(__CLASS__);
8888
$logger->info('Mail properties', [$email]);
8989
}
90-
if (!GeneralUtility::validEmail($email['receiverEmail']) ||
91-
!GeneralUtility::validEmail($email['senderEmail'])) {
92-
return false;
93-
}
9490
if (empty($email['subject'])) {
9591
// don't want an error flashmessage
9692
return true;
9793
}
94+
if (!GeneralUtility::validEmail($email['receiverEmail']) ||
95+
!GeneralUtility::validEmail($email['senderEmail'])) {
96+
return false;
97+
}
9898
return $this->prepareAndSend($email);
9999
}
100100

0 commit comments

Comments
 (0)