Convert register admin notification to new email API
authorTim Düsterhus <duesterhus@woltlab.com>
Mon, 6 Jun 2016 21:36:02 +0000 (23:36 +0200)
committerTim Düsterhus <duesterhus@woltlab.com>
Thu, 28 Jul 2016 20:06:18 +0000 (22:06 +0200)
wcfsetup/install/files/lib/form/RegisterForm.class.php

index 28f9cd8e931e73b841b315d86eaa4f281e67e8f0..617c048775eb821841db5aa52cb5e578c47d7ed2 100644 (file)
@@ -16,8 +16,10 @@ use wcf\system\exception\SystemException;
 use wcf\system\exception\UserInputException;
 use wcf\system\language\LanguageFactory;
 use wcf\system\email\mime\MimePartFacade;
+use wcf\system\email\mime\PlainTextMimePart;
 use wcf\system\email\mime\RecipientAwareTextMimePart;
 use wcf\system\email\Email;
+use wcf\system\email\Mailbox;
 use wcf\system\email\UserMailbox;
 use wcf\system\request\LinkHandler;
 use wcf\system\user\authentication\UserAuthenticationFactory;
@@ -488,13 +490,11 @@ class RegisterForm extends UserAddForm {
                        // get default language
                        $language = LanguageFactory::getInstance()->getLanguage(LanguageFactory::getInstance()->getDefaultLanguageID());
                        
-                       // send mail
-                       $mail = new Mail(MAIL_ADMIN_ADDRESS, 
-                               $language->getDynamicVariable('wcf.user.register.notification.mail.subject'),
-                               $language->getDynamicVariable('wcf.user.register.notification.mail', ['user' => $user])
-                       );
-                       $mail->setLanguage($language);
-                       $mail->send();
+                       $email = new Email();
+                       $email->addRecipient(new Mailbox(MAIL_ADMIN_ADDRESS, null, $language));
+                       $email->setSubject($language->getDynamicVariable('wcf.user.register.notification.mail.subject'));
+                       $email->setBody(new PlainTextMimePart($language->getDynamicVariable('wcf.user.register.notification.mail', ['user' => $user])));
+                       $email->send();
                }
                
                if ($this->captchaObjectType) {