From f1478e5929c40763166874c9bed013745efb5772 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim=20D=C3=BCsterhus?= Date: Fri, 24 Jul 2015 17:17:43 +0200 Subject: [PATCH] Add $language parameter to \wcf\system\email\Mailbox --- .../files/lib/system/email/Mailbox.class.php | 23 ++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/wcfsetup/install/files/lib/system/email/Mailbox.class.php b/wcfsetup/install/files/lib/system/email/Mailbox.class.php index f94858e4e5..65abde2d93 100644 --- a/wcfsetup/install/files/lib/system/email/Mailbox.class.php +++ b/wcfsetup/install/files/lib/system/email/Mailbox.class.php @@ -1,6 +1,8 @@ address = $address; $this->name = $name; + if ($language === null) { + $language = LanguageFactory::getInstance()->getLanguage(LanguageFactory::getInstance()->getDefaultLanguageID()); + } + $this->language = $language; } /** @@ -58,6 +65,16 @@ class Mailbox { return $this->address; } + /** + * Returns the language the recipient of this mailbox wants. + * This is used for localization of the email template. + * + * @return \wcf\data\language\Language + */ + public function getLanguage() { + return $this->language; + } + /** * Returns a string representation for use in a RFC 5233 message. * -- 2.20.1