Beispiel #1
0
 /**
  * Prepare the newsletter content for the specified email (substitute markers and insert spies)
  * @param \Ecodev\Newsletter\Domain\Model\Email $email
  * @param boolean $isPreview whether we are preparing a preview version of the newsletter
  */
 public function prepare(Email $email, $isPreview = false)
 {
     $this->resetContent();
     if ($this->newsletter->getInjectOpenSpy()) {
         $this->injectOpenSpy($email);
     }
     if ($this->newsletter->getInjectLinksSpy()) {
         $this->injectLinksSpy($email, $isPreview);
     }
     // We substitute markers last because we don't want to spy each links to view/unsubscribe
     // (created via markers) for each recipient. Only the generic marker is enough.
     // Otherwise we would mess up opened link statistics
     $this->substituteMarkers($email);
 }
 /**
  * @test
  */
 public function getInjectOpenSpyReturnsInitialValueForBoolean()
 {
     $this->assertSame(true, $this->subject->getInjectOpenSpy());
     $this->assertSame(true, $this->subject->isInjectOpenSpy());
 }