Ejemplo n.º 1
0
 /**
  * @param        $email
  * @param string $reason
  * @param bool   $flush
  */
 public function setBounceDoNotContact($email, $reason = '', $flush = true)
 {
     $repo = $this->getRepository();
     if (!$repo->checkDoNotEmail($email)) {
         $dnc = new DoNotEmail();
         $dnc->setEmailAddress($email);
         $dnc->setDateAdded(new \DateTime());
         $dnc->setBounced();
         $dnc->setComments($reason);
         $em = $this->factory->getEntityManager();
         $em->persist($dnc);
         if ($flush) {
             $em->flush();
         }
     }
 }
 /**
  * {@inheritDoc}
  */
 public function setBounced($bounced = true)
 {
     $this->__initializer__ && $this->__initializer__->__invoke($this, 'setBounced', array($bounced));
     return parent::setBounced($bounced);
 }