/** * @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 zweite Mail nach dem Anfordern eines neues * Passworts. */ public function sendPasswordMail2() { // Neues PW erzeugen $pw = $this->generateCredentials(false); $this->us_hash = ''; $this->save(); // Mail senden $temp = new ControlContainer(null, ''); $temp->setSkinFile('modules/default/mails/newPW_2.mail'); $temp->setEntity($this); $temp->setVar('pw', $pw); $nachricht = $temp->toHtml(); $empfaenger = $this->us_email; $betreff = utf8_decode('Ihre Passwortanfrage für die Webseite'); unset($pw); return Mailer::getInstance()->sendMail($empfaenger, $betreff, $nachricht); }