Skip to content

Commit

Permalink
Added missing anonymous tracking condition
Browse files Browse the repository at this point in the history
  • Loading branch information
bencroker committed Mar 14, 2022
1 parent 2585708 commit 282332e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/elements/CampaignElement.php
Original file line number Diff line number Diff line change
Expand Up @@ -649,7 +649,7 @@ public function getStatus(): ?string
*/
public function hasRevisions(): bool
{
return $this->getCampaignType()->enableVersioning;
return true;
}

/**
Expand Down
10 changes: 8 additions & 2 deletions src/services/CampaignsService.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,10 @@ public function addContactInteraction(ContactElement $contact, SendoutElement $s
}

/** @var CampaignRecord|null $campaignRecord */
$campaignRecord = CampaignRecord::findOne($sendout->campaignId);
$campaignRecord = CampaignRecord::find()
->where(['id' => $sendout->campaignId])
->with('campaignType')
->one();

if ($campaignRecord === null) {
return;
Expand Down Expand Up @@ -103,7 +106,10 @@ public function addContactInteraction(ContactElement $contact, SendoutElement $s
}
}

$contactCampaignRecord->save();
// Only save is anonymous tracking is not enabled
if ($campaignRecord->campaignType->enableAnonymousTracking === false) {
$contactCampaignRecord->save();
}

$campaignRecord->save();
}
Expand Down

0 comments on commit 282332e

Please sign in to comment.