Skip to content

Commit

Permalink
Promotes the $fromMailAddress property.
Browse files Browse the repository at this point in the history
Co-authored-by: Côme Chilliet <91878298+come-nc@users.noreply.github.com>
Signed-off-by: Faraz Samapoor <f.samapoor@gmail.com>
  • Loading branch information
Faraz Samapoor and come-nc committed Jun 12, 2023
1 parent 4912fa3 commit 5264acc
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions core/Controller/LostController.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,6 @@
* @package OC\Core\Controller
*/
class LostController extends Controller {
protected string $from;

public function __construct(
string $appName,
IRequest $request,
Expand All @@ -83,7 +81,7 @@ public function __construct(
private Defaults $defaults,
private IL10N $l10n,
private IConfig $config,
string $defaultMailAddress,
protected string $fromMailAddress,
private IManager $encryptionManager,
private IMailer $mailer,
private LoggerInterface $logger,
Expand All @@ -94,7 +92,6 @@ public function __construct(
private Limiter $limiter,
) {
parent::__construct($appName, $request);
$this->from = $defaultMailAddress;
}

/**
Expand Down Expand Up @@ -299,7 +296,7 @@ protected function sendEmail(string $input): void {
try {
$message = $this->mailer->createMessage();
$message->setTo([$email => $user->getDisplayName()]);
$message->setFrom([$this->from => $this->defaults->getName()]);
$message->setFrom([$this->fromMailAddress => $this->defaults->getName()]);
$message->useTemplate($emailTemplate);
$this->mailer->send($message);
} catch (Exception $e) {
Expand Down

0 comments on commit 5264acc

Please sign in to comment.