Fixed XF\Mail\Mail::setLanguage() doesn't return $this

DragonByte Tech

Well-known member
Affected version
2.0.0 Beta 1
Literally every other set* function in that file has return $this; except for that function.

PHP:
                // Create appropriate mail object
                \XF::app()->mailer()->newMail()
                    ->setTemplate('dbtech_mail_new_unsubscription_mailinglist', [
                        'mailinglist' => $mailinglist,
                        'brandingVariables' => $brandingVariables,
                        'user' => $user,
                        'reason' => $unsubscribereason . ($cleanedInput['unsubscribereason_other'] ? (' - ' . $cleanedInput['unsubscribereason_other']) : ''),
                    ])
                    ->setLanguage(\XF::app()->language(DBTech::option('languageid')))
                    ->setTo(DBTech::option('defaultEmailAddress'))
                    ->setFrom($user->email, $user->username)
                    ->send();

Produces
Call to a member function setTo() on null

I'm so confident of this getting fixed I'm going to edit the file on my end, and you can't stop me :P


Fillip
 
Top Bottom