/** * Insert tracking beacon * allows to see if an email is viewed or not * * @return string */ public function insertBeacon(&$html) { $beaconHtml = "<img alt=\"{$this->_recipient->getCampaign()->getStore()->getName()}\" src=\"{$this->getBeaconImage()}\" style=\"width:10px; height:5px;\" />"; // if beacon placeholder exist replace it if (strpos($html, self::BEACON_PLACEHOLDER) !== false) { $html = str_replace(self::BEACON_PLACEHOLDER, $beaconHtml, $html); } else { if (strpos($html, "</body>") !== false) { $html = str_replace("</body>", "{$beaconHtml}\n</body>", $html); } else { $html .= $beaconHtml; } } return $this; }
/** * Set recipient * * @param Mzax_Emarketing_Model_Recipient $recipient * @return Mzax_Emarketing_Model_Recipient_Bounce_Message */ public function setRecipient(Mzax_Emarketing_Model_Recipient $recipient) { $this->_recipient = $recipient; if ($this->_campaign) { $this->_recipient->setCampaign($this->_campaign); } else { $this->_campaign = $recipient->getCampaign(); } return $this; }