Testbetrieb: eine Schranke fuer jede ausgehende E-Mail
Deploy FeWo mit PipelineManager / deploy (push) Failing after 3m10s
Deploy FeWo mit PipelineManager / deploy (push) Failing after 3m10s
EnforceMailTestMode prueft jede Mail unmittelbar vor dem Versand (MessageSending, jeder Mailer): im Testbetrieb gehen An/Cc/Bcc nur an die Testadresse, ohne Testadresse wird nichts versendet; der Modus wird je Mail frisch gelesen. Ersetzt alwaysTo am Standard-Mailer. Tests inkl. Pruefung, dass kein Code am Mailer vorbei versendet. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
ac9d20b812
commit
0c10880e4f
6 files changed
+248
-9
No files matched your search
@@ -2,8 +2,8 @@
|
||||
|
||||
namespace App\Tenancy;
|
||||
|
||||
use App\Listeners\EnforceMailTestMode;
|
||||
use App\Models\Tenant;
|
||||
use App\Support\Settings;
|
||||
use Illuminate\Mail\MailManager;
|
||||
use Illuminate\Support\Facades\Mail;
|
||||
use Throwable;
|
||||
@@ -146,7 +146,8 @@ public function apply(?Tenant $tenant): void
|
||||
}
|
||||
|
||||
/**
|
||||
* The mailer sends everything to one address while the landlord is in test mode.
|
||||
* Rebuilds the mailers so that they use the sender of the current landlord. Where mails go in test operation is
|
||||
* decided for every single mail by the one gate {@see EnforceMailTestMode}, not here.
|
||||
*/
|
||||
public function applyMailRouting(?Tenant $tenant): void
|
||||
{
|
||||
@@ -157,11 +158,6 @@ public function applyMailRouting(?Tenant $tenant): void
|
||||
}
|
||||
|
||||
$manager->purge();
|
||||
$redirect = Settings::mailRedirectFor($tenant);
|
||||
|
||||
if (filled($redirect)) {
|
||||
$manager->alwaysTo($redirect);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user