-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added redirect link to sendinblue #357
Added redirect link to sendinblue #357
Conversation
Event/SendinblueListSubscriber.php
Outdated
public function __construct( | ||
RequestStack $requestStack, | ||
LinkProviderPoolInterface $linkProviderPool, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@alexander-schranz can we do the BC break here or should we add a BC layer?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as it is not much work a bc layer should be added here. includes that this need to be the the last parameter here and be = null
by default
Event/SendinblueListSubscriber.php
Outdated
@@ -126,4 +140,35 @@ public function listSubscribe(FormSavePostEvent $event): void | |||
$this->contactsApi->createDoiContact($createDoiContact); | |||
} | |||
} | |||
|
|||
/** | |||
* @param array<string, ?string> $redirectLink |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
define this more specific
Event/SendinblueListSubscriber.php
Outdated
@@ -97,6 +106,11 @@ public function listSubscribe(FormSavePostEvent $event): void | |||
$mailTemplateId = $field['options']['mailTemplateId'] ?? null; | |||
/** @var int|null $listId */ | |||
$listId = $field['options']['listId'] ?? null; | |||
$redirectLink = $field['options']['redirectLink'] ?? null; | |||
|
|||
if ($redirectLink && $this->linkProviderPool) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move check for $this->linkProviderPool
that way phpstan now:
if ($redirectLink && $this->linkProviderPool) { | |
if ($redirectLink) { |
return $redirectLink['href']; | ||
} | ||
|
||
$linkProvider = $this->linkProviderPool->getProvider($redirectLink['provider']); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$linkProvider = $this->linkProviderPool->getProvider($redirectLink['provider']); | |
if (!$this->linkProviderPool) { | |
return null; | |
} | |
$linkProvider = $this->linkProviderPool->getProvider($redirectLink['provider']); |
What's in this PR?
Adds redirect link to sendinblue.