Change method parameter name
[MAILPOET-4137]
This commit is contained in:
@ -70,10 +70,10 @@ class ManageSubscriptionFormRenderer {
|
|||||||
$this->segmentsRepository = $segmentsRepository;
|
$this->segmentsRepository = $segmentsRepository;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function renderForm(SubscriberEntity $subscriberEntity, string $formState = self::FORM_STATE_NOT_SUBMITTED): string {
|
public function renderForm(SubscriberEntity $subscriber, string $formState = self::FORM_STATE_NOT_SUBMITTED): string {
|
||||||
$basicFields = $this->getBasicFields($subscriberEntity);
|
$basicFields = $this->getBasicFields($subscriber);
|
||||||
$customFields = $this->getCustomFields($subscriberEntity);
|
$customFields = $this->getCustomFields($subscriber);
|
||||||
$segmentField = $this->getSegmentField($subscriberEntity);
|
$segmentField = $this->getSegmentField($subscriber);
|
||||||
|
|
||||||
$form = array_merge(
|
$form = array_merge(
|
||||||
$basicFields,
|
$basicFields,
|
||||||
@ -95,16 +95,16 @@ class ManageSubscriptionFormRenderer {
|
|||||||
$templateData = [
|
$templateData = [
|
||||||
'actionUrl' => admin_url('admin-post.php'),
|
'actionUrl' => admin_url('admin-post.php'),
|
||||||
'redirectUrl' => $this->urlHelper->getCurrentUrl(),
|
'redirectUrl' => $this->urlHelper->getCurrentUrl(),
|
||||||
'email' => $subscriberEntity->getEmail(),
|
'email' => $subscriber->getEmail(),
|
||||||
'token' => $this->linkTokens->getToken($subscriberEntity),
|
'token' => $this->linkTokens->getToken($subscriber),
|
||||||
'editEmailInfo' => __('Need to change your email address? Unsubscribe using the form below, then simply sign up again.', 'mailpoet'),
|
'editEmailInfo' => __('Need to change your email address? Unsubscribe using the form below, then simply sign up again.', 'mailpoet'),
|
||||||
'formHtml' => $this->formRenderer->renderBlocks($form, [], null, $honeypot = false, $captcha = false),
|
'formHtml' => $this->formRenderer->renderBlocks($form, [], null, $honeypot = false, $captcha = false),
|
||||||
'formState' => $formState,
|
'formState' => $formState,
|
||||||
];
|
];
|
||||||
|
|
||||||
if ($subscriberEntity->isWPUser() || $subscriberEntity->getIsWoocommerceUser()) {
|
if ($subscriber->isWPUser() || $subscriber->getIsWoocommerceUser()) {
|
||||||
$wpCurrentUser = $this->wp->wpGetCurrentUser();
|
$wpCurrentUser = $this->wp->wpGetCurrentUser();
|
||||||
if ($wpCurrentUser->user_email === $subscriberEntity->getEmail()) { // phpcs:ignore Squiz.NamingConventions.ValidVariableName.MemberNotCamelCaps
|
if ($wpCurrentUser->user_email === $subscriber->getEmail()) { // phpcs:ignore Squiz.NamingConventions.ValidVariableName.MemberNotCamelCaps
|
||||||
$templateData['editEmailInfo'] = Helpers::replaceLinkTags(
|
$templateData['editEmailInfo'] = Helpers::replaceLinkTags(
|
||||||
__('[link]Edit your profile[/link] to update your email.', 'mailpoet'),
|
__('[link]Edit your profile[/link] to update your email.', 'mailpoet'),
|
||||||
$this->wp->getEditProfileUrl(),
|
$this->wp->getEditProfileUrl(),
|
||||||
|
Reference in New Issue
Block a user