fix: ensure MailJet exclusion flag is revoked for new subscriptions

This commit is contained in:
Björn Fromme
2026-04-30 12:24:42 +02:00
parent 68900dd4ea
commit 77ad96baf9
2 changed files with 10 additions and 6 deletions
+4 -5
View File
@@ -105,7 +105,7 @@ class NewsletterManager
$missingListIds = array_values(array_diff($normalizedListIds, $confirmedListIds));
if ([] === $missingListIds) {
$this->recordSubscription($normalizedEmail, $normalizedListIds, [], $normalizedFirstName, $normalizedLastName);
$this->recordSubscription($normalizedEmail, $normalizedListIds, $normalizedFirstName, $normalizedLastName);
return new NewsletterSubscriptionRequestResult(
$normalizedEmail,
@@ -116,7 +116,7 @@ class NewsletterManager
);
}
$this->recordSubscription($normalizedEmail, $normalizedListIds, $missingListIds, $normalizedFirstName, $normalizedLastName);
$this->recordSubscription($normalizedEmail, $normalizedListIds, $normalizedFirstName, $normalizedLastName);
return new NewsletterSubscriptionRequestResult(
$normalizedEmail,
@@ -408,13 +408,12 @@ class NewsletterManager
/**
* @param list<int> $mailjetListIds
* @param list<int> $missingListIds
*/
private function recordSubscription(string $email, array $mailjetListIds, array $missingListIds, ?string $firstName, ?string $lastName): void
private function recordSubscription(string $email, array $mailjetListIds, ?string $firstName, ?string $lastName): void
{
$this->syncMailjetContact($email, $firstName, $lastName);
foreach ($missingListIds as $mailjetListId) {
foreach ($mailjetListIds as $mailjetListId) {
$this->newsletterService->ensureSubscribed($email, $mailjetListId);
}