Exemple #1
0
 /**
  * @return string
  */
 private function getHtmlSignature()
 {
     if (!empty($this->mailSignature)) {
         if ($this->mailSignature === strip_tags($this->mailSignature)) {
             return $this->stringFormatter->nl2p($this->mailSignature);
         }
         return $this->mailSignature;
     }
     return '';
 }
Exemple #2
0
 /**
  * @param string $emailAddress
  * @param string $hash
  *
  * @return bool
  */
 protected function sendDoubleOptInEmail($emailAddress, $hash)
 {
     $url = $this->router->route('newsletter/index/activate/hash_' . $hash, true);
     $systemSettings = $this->config->getSettings(\ACP3\Modules\ACP3\System\Installer\Schema::MODULE_NAME);
     $settings = $this->config->getSettings(Schema::MODULE_NAME);
     $subject = $this->translator->t('newsletter', 'subscribe_mail_subject', ['%title%' => $systemSettings['site_title']]);
     $body = $this->translator->t('newsletter', 'subscribe_mail_body', ['{host}' => $this->request->getHost()]) . "\n\n";
     $from = ['email' => $settings['mail'], 'name' => $systemSettings['site_title']];
     $this->mailer->reset()->setFrom($from)->setSubject($subject)->setMailSignature($settings['mailsig']);
     if ($settings['html'] == 1) {
         $this->mailer->setTemplate('newsletter/layout.email.tpl');
         $body .= '<a href="' . $url . '">' . $url . '<a>';
         $this->mailer->setHtmlBody($this->stringFormatter->nl2p($body));
     } else {
         $body .= $url;
         $this->mailer->setBody($body);
     }
     $this->mailer->setRecipients($emailAddress);
     return $this->mailer->send();
 }
Exemple #3
0
 /**
  * @inheritdoc
  */
 protected function getDbValueIfExists(array $dbResultRow, $field)
 {
     return isset($dbResultRow[$field]) ? $this->stringFormatter->nl2p($dbResultRow[$field]) : null;
 }
Exemple #4
0
 /**
  * @inheritdoc
  */
 public function process($value)
 {
     return $this->stringFormatter->nl2p($value);
 }