Fixed UserEmail job missing "from_email" and "from_name" default values

DragonByte Tech

Well-known member
Affected version
2.0.12
There's a regression from 2.0.11 where 3rd party addons that use UserEmail as a base class will no longer send email, because of this change:

$mail = $this->getMail($user); -> $mail = $this->getMail($user)->setFrom($email['from_email'], $email['from_name']);

While this isn't an issue for XF2 itself, I would still request that the relevant block of code is changed to this:
PHP:
        $options = \XF::options();

        $language = $this->app->language($user->language_id);
        $email = $this->data['email'];
        
        $email = array_replace([
            'from_name' => $options->emailSenderName ? $options->emailSenderName : $options->boardTitle,
            'from_email' => $options->defaultEmailAddress,
            'email_body' => '',
            'email_title' => '',
            'email_format' => 'text',
            'email_wrapped' => true,
            'email_unsub' => false,
        ], $email);

Thank you for considering.


Fillip
 
Thank you for reporting this issue. The issue is now resolved and we are aiming to include that in a future XF release (2.0.13).

Change log:
Set reasonable defaults for from_email and from_name in the UserEmail job.
Any changes made as a result of this issue being resolved may not be rolled out here until later.
 
Back
Top Bottom