• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

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

Affected version
2.0.0 Beta 1

DragonByte Tech

Well-known member
#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