1 | <?php |
||
9 | class PersonalizeHtmlAction |
||
10 | { |
||
11 | public function execute($html, CampaignSend $pendingSend) |
||
12 | { |
||
13 | /** @var \Spatie\EmailCampaigns\Models\Subscription $subscription */ |
||
14 | $subscription = $pendingSend->subscription; |
||
15 | |||
16 | $html = str_replace('::campaignSendUuid::', $pendingSend->uuid, $html); |
||
17 | $html = str_replace('::subscriptionUuid::', $subscription->uuid, $html); |
||
18 | $html = str_replace('::subscriber.uuid::', $subscription->subscriber->uuid, $html); |
||
19 | $html = str_replace('::unsubscribeUrl::', $subscription->unsubscribeUrl($pendingSend), $html); |
||
20 | |||
21 | $html = $this->replaceSubscriberAttributes($html, $subscription->subscriber); |
||
22 | |||
23 | return $html; |
||
24 | } |
||
25 | |||
26 | protected function replaceSubscriberAttributes(string $html, Subscriber $subscriber): string |
||
46 | } |
||
47 |