login = $login; $this->ip = $ip; $this->resetUrl = $resetUrl; $this->setUpEmail(); } private function setUpEmail() { $replytoEmailName = Config::getInstance()->General['login_password_recovery_replyto_email_name']; $replytoEmailAddress = Config::getInstance()->General['login_password_recovery_replyto_email_address']; $this->setSubject($this->getDefaultSubject()); $this->addReplyTo($replytoEmailAddress, $replytoEmailName); $this->setWrappedHtmlBody($this->getHTMLBody()); $this->setBodyText($this->getDefaultBodyText()); } private function getDefaultSubject() { return Piwik::translate('Login_MailTopicPasswordChange'); } /** * Get the translated plain text email body with the reset link * * @return string */ private function getDefaultBodyText() : string { return Piwik::translate('Login_MailPasswordChangeBody2', [Common::sanitizeInputValue($this->login), Common::sanitizeInputValue($this->ip), Common::sanitizeInputValue($this->resetUrl)]); } /** * Create the HTML email body from the plain text body * * @return string */ private function getHTMLBody() : string { return '

' . str_replace( "\n\n", "

", Piwik::translate('Login_MailPasswordChangeBody2', [Common::sanitizeInputValue($this->login), Common::sanitizeInputValue($this->ip), '

'. Common::sanitizeInputValue($this->resetUrl).'

']) ) . "

"; } }