Make sure source is updated only on status change

[MAILPOET-2737]
This commit is contained in:
Pavel Dohnal
2020-06-24 08:00:58 +02:00
committed by Veljko V
parent 6d0977c7fe
commit 0a5f941ae6

View File

@ -385,6 +385,7 @@ class Subscribers extends APIEndpoint {
isset($data['status'])
&& ($data['status'] === SubscriberEntity::STATUS_UNSUBSCRIBED)
&& ($oldSubscriber instanceof Subscriber)
&& ($oldSubscriber->status !== SubscriberEntity::STATUS_UNSUBSCRIBED)
) {
$currentUser = $this->wp->wpGetCurrentUser();
$this->unsubscribesTracker->track(