/** * @param User $user * @param $betreff * @param string $activationLink * @param string $template * @return bool|string */ public static function activate(User $user, $betreff, $activationLink = '', $template = '') { if ($user->us_email == '') { return false; } if ($template == '') { $template = __DIR__ . '/Mails/UserActivate.template.html'; } if ($activationLink == '') { // TODO: Default-Link generieren } // Mail senden $temp = new ControlContainer(null, ''); $temp->setSkinfile($template); $temp->setEntity($user); $temp->setVar('activationLink', $activationLink); $nachrichttext = $temp->toHtml(); $empfaenger = $user->us_email; return Mailer::getInstance()->sendMail($empfaenger, $betreff, $nachrichttext, $nachrichttext); }
/** * Diese Methode sendet die Mail nach Anforderung des Benutzernamens */ public function sendUsernameMail() { // Mail senden $temp = new ControlContainer(null, ''); $temp->setSkinFile('modules/default/mails/benutzername.mail'); $temp->setEntity($this); $nachricht = $temp->toHtml(); $empfaenger = $this->us_email; $betreff = utf8_decode('Ihr Benutzername für die Webseite'); return Mailer::getInstance()->sendMail($empfaenger, $betreff, $nachricht); }
/** * Shortcut Methode, die die übergebene Nachricht an den in der Konfiguration * hinterlegten Eigentümer sendet. * * @param string $betreff * @param string $nachricht */ public static function sendNotification($betreff, $nachricht) { Mailer::getInstance()->sendMail(Configuration::get('mail.from'), $betreff, $nachricht); }
/** * @covers \NewFrontiers\Framework\Output\Mailer::sendMail * @covers \NewFrontiers\Framework\Output\Mailer::sendNotification * @covers \NewFrontiers\Framework\Output\Mailer::getInstance */ public function testSendNotification() { $this->assertSame(Mailer::getInstance(), Mailer::getInstance()); Configuration::getInstance()->readConfig(); $mailer = $this->createMailerMock($lastMail); $this->assertSame($mailer, Mailer::getInstance()); Mailer::sendNotification("test", "testnachricht"); $fromAndTo = Configuration::get('mail.from'); $this->assertContains("Subject: test", $lastMail); $this->assertContains("From: " . $fromAndTo, $lastMail); $this->assertContains("To: " . $fromAndTo, $lastMail); $this->assertContains("\ntestnachricht", $lastMail); }
public function mailtest() { if (!isset($this->request->empfaenger)) { $this->request->empfaenger = '*****@*****.**'; } Mailer::getInstance()->sendMail($this->request->empfaenger, 'Test NFS Framework', 'Dies ist ein Test'); }