From: Tim Düsterhus Date: Sun, 5 Jun 2016 19:55:23 +0000 (+0200) Subject: Use new email API in RegisterNewActivationCodeForm X-Git-Tag: 3.0.0_Beta_1~916^2~8 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=ff6859eceea2c92041ef649653fa28b1e8264a4e;p=GitHub%2FWoltLab%2FWCF.git Use new email API in RegisterNewActivationCodeForm --- diff --git a/wcfsetup/install/files/lib/form/RegisterNewActivationCodeForm.class.php b/wcfsetup/install/files/lib/form/RegisterNewActivationCodeForm.class.php index 020060a0ea..d2e3bd9d0c 100644 --- a/wcfsetup/install/files/lib/form/RegisterNewActivationCodeForm.class.php +++ b/wcfsetup/install/files/lib/form/RegisterNewActivationCodeForm.class.php @@ -4,7 +4,10 @@ use wcf\data\user\User; use wcf\data\user\UserAction; use wcf\system\exception\IllegalLinkException; use wcf\system\exception\UserInputException; -use wcf\system\mail\Mail; +use wcf\system\email\mime\MimePartFacade; +use wcf\system\email\mime\RecipientAwareTextMimePart; +use wcf\system\email\Email; +use wcf\system\email\UserMailbox; use wcf\system\request\LinkHandler; use wcf\system\WCF; use wcf\util\HeaderUtil; @@ -147,8 +150,14 @@ class RegisterNewActivationCodeForm extends AbstractForm { $this->user = new User($this->user->userID); // send activation mail - $mail = new Mail([$this->user->username => (!empty($this->email) ? $this->email : $this->user->email)], WCF::getLanguage()->getDynamicVariable('wcf.user.register.needActivation.mail.subject'), WCF::getLanguage()->getDynamicVariable('wcf.user.register.needActivation.mail', ['user' => $this->user])); - $mail->send(); + $email = new Email(); + $email->addRecipient(new UserMailbox($this->user)); + $email->setSubject(WCF::getLanguage()->getDynamicVariable('wcf.user.register.needActivation.mail.subject')); + $email->setBody(new MimePartFacade([ + new RecipientAwareTextMimePart('text/html', 'email_registerNeedActivation'), + new RecipientAwareTextMimePart('text/plain', 'email_registerNeedActivation') + ])); + $email->send(); $this->saved(); // forward to index page