From 11c3a762b816336a329119280b7f14289a8155dc Mon Sep 17 00:00:00 2001 From: Igor Scheller Date: Mon, 20 Dec 2021 21:07:00 +0100 Subject: [PATCH] Remove space from email subjects --- src/Mail/EngelsystemMailer.php | 2 +- tests/Unit/Mail/EngelsystemMailerTest.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Mail/EngelsystemMailer.php b/src/Mail/EngelsystemMailer.php index 36cd33af..fe6e9f8b 100644 --- a/src/Mail/EngelsystemMailer.php +++ b/src/Mail/EngelsystemMailer.php @@ -98,7 +98,7 @@ class EngelsystemMailer extends Mailer public function send($to, string $subject, string $body): int { if ($this->subjectPrefix) { - $subject = sprintf('[%s] %s', $this->subjectPrefix, $subject); + $subject = sprintf('[%s] %s', $this->subjectPrefix, trim($subject)); } return parent::send($to, $subject, $body); diff --git a/tests/Unit/Mail/EngelsystemMailerTest.php b/tests/Unit/Mail/EngelsystemMailerTest.php index 8d649004..6a3642e5 100644 --- a/tests/Unit/Mail/EngelsystemMailerTest.php +++ b/tests/Unit/Mail/EngelsystemMailerTest.php @@ -108,7 +108,7 @@ class EngelsystemMailerTest extends TestCase $this->assertEquals('Mail test', $mailer->getSubjectPrefix()); - $return = $mailer->send('to@xam.pel', 'Foo Bar', 'Lorem Ipsum!'); + $return = $mailer->send('to@xam.pel', 'Foo Bar ', 'Lorem Ipsum!'); $this->assertEquals(1, $return); } }