Skip to content
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

Merged

Conversation

martinlagler
Copy link
Contributor

Q A
Bug fix? no
New feature? yes
BC breaks? no
Deprecations? no
License MIT

What's in this PR?

Adds redirect link to sendinblue.

public function __construct(
RequestStack $requestStack,
LinkProviderPoolInterface $linkProviderPool,
Copy link
Member

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?

Copy link
Member

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

@@ -126,4 +140,35 @@ public function listSubscribe(FormSavePostEvent $event): void
$this->contactsApi->createDoiContact($createDoiContact);
}
}

/**
* @param array<string, ?string> $redirectLink
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

define this more specific

@@ -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) {
Copy link
Member

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:

Suggested change
if ($redirectLink && $this->linkProviderPool) {
if ($redirectLink) {

return $redirectLink['href'];
}

$linkProvider = $this->linkProviderPool->getProvider($redirectLink['provider']);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
$linkProvider = $this->linkProviderPool->getProvider($redirectLink['provider']);
if (!$this->linkProviderPool) {
return null;
}
$linkProvider = $this->linkProviderPool->getProvider($redirectLink['provider']);

@alexander-schranz alexander-schranz merged commit 3dd6596 into sulu:2.5 Apr 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants