feat: copy the house managers of the selected houses on assignment mailings

This commit is contained in:
fromme committed 2026-11-12 12:45:53 +01:00
1 parent 2c51ddf86f
commit f22d1f1199
17 files changed
+293 -24

No files matched your search

@@ -338,6 +338,52 @@ class TeamerMailingServiceTest extends TestCase
$this->assertSame(['[email protected]', '[email protected]'], $replyTo);
}
public function testSendMailingPutsEachRecipientsCcOnTheirMailOnly(): void
{
$cc = [];
$this->mailer
->expects($this->exactly(2))
->method('createAndSendEmail')
->willReturnCallback(function (array $context, array $options) use (&$cc): void {
$cc[$options['to']] = $options['cc'];
})
;
$anna = $this->createRecipient('Anna', 'Berg', '[email protected]');
$recipients = (new TeamerMailingRecipientsDto())
->addEligible($anna)
->addEligible($this->createRecipient('Bea', 'Ohm', '[email protected]'))
;
$this->service->sendMailing(SendTeamerMailing::fromRecipients(
'Betreff',
'Nachricht',
$recipients,
cc: [$anna->getId() => ['[email protected]', '[email protected]']]
));
$this->assertSame([
'[email protected]' => ['[email protected]', '[email protected]'],
'[email protected]' => [],
], $cc);
}
public function testAMailingQueuedWithoutTheCcSendsNone(): void
{
$this->mailer
->expects($this->once())
->method('createAndSendEmail')
->willReturnCallback(function (array $context, array $options): void {
$this->assertSame([], $options['cc']);
})
;
// the snapshot as it was queued before the 'cc' key existed
$this->service->sendMailing(new SendTeamerMailing('Betreff', 'Nachricht', [
['email' => '[email protected]', 'firstName' => 'Anna', 'lastName' => 'Berg', 'fullName' => 'Anna Berg'],
]));
}
/**
* A preview has to stay on the default relay and the default queue, or composing a
* mailing would wait on the same worker the mailing itself is queued behind.