/**
  * Send a validation mail to the passed user
  *
  * @param User $user a user-object or id of the user
  *                   to resend the validation mail for
  * 
  * @return void
  */
 public static function sendValidationMail($user)
 {
     global $_language_path;
     // if no user-object is given interpret it as a user-id
     if (is_string($user)) {
         $user = new User($user);
     }
     // template-variables for the include partial
     $Zeit = date("H:i:s, d.m.Y", $user->mkdate);
     $username = $user->username;
     $Vorname = $user->vorname;
     $Nachname = $user->nachname;
     $Email = $user->email;
     // (re-)send the confirmation mail
     $to = $user->email;
     $secret = md5($user->user_id . ':' . self::$magic);
     $url = $GLOBALS['ABSOLUTE_URI_STUDIP'] . "email_validation.php?secret=" . $secret;
     $mail = new StudipMail();
     $abuse = $mail->getReplyToEmail();
     // include language-specific subject and mailbody
     include_once "locale/{$_language_path}/LC_MAILS/register_mail.inc.php";
     // send the mail
     $mail->setSubject($subject)->addRecipient($to)->setBodyText($mailbody)->send();
 }
Example #2
0
 /**
  * convenience method for sending a qick, text based email message
  * to the configured abuse adress
  *
  * @param string $subject
  * @param string $text
  * @return bool
  */
 public static function sendAbuseMessage($subject, $text)
 {
     $mail = new StudipMail();
     $abuse = $mail->getReplyToEmail();
     return $mail->setSubject($subject)->setReplyToEmail('')->addRecipient($abuse)->setBodyText($text)->send();
 }