Karaka-Management / phpOMS

PHP Framework
Other
2 stars 0 forks source link

Fix email template parsing. #358

Closed spl1nes closed 7 months ago

spl1nes commented 7 months ago

Instead of doing something like this:

        $mail->body = \str_replace(
            [
                '{new_password}',
                '{user_name}',
            ],
            [
                $pass,
                $account->login,
            ],
            $mailL11n->body
        );

        $mail->bodyAlt = \str_replace(
            [
                '{new_password}',
                '{user_name}',
            ],
            [
                $pass,
                $account->login,
            ],
            $mailL11n->bodyAlt
        );

An array key=>value should be stored in the email model which then gets parsed in the send call $handler->send($mail);.