Skip to content

Commit

Permalink
strval fix
Browse files Browse the repository at this point in the history
  • Loading branch information
jan-stanek committed Sep 30, 2023
1 parent c8129d8 commit 888866b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions app/Services/MailService.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@

use function in_array;
use function str_replace;
use function strval;

/**
* Služba pro rozesílání e-mailů.
Expand Down Expand Up @@ -132,7 +133,7 @@ public function sendMail(Collection|null $recipientsRoles, Collection|null $reci
*
* @param Collection<int, User>|null $recipientsUsers
* @param Collection<int, string>|null $recipientsEmails
* @param string[] $parameters
* @param mixed[] $parameters
*
* @throws MailingMailCreationException
* @throws SettingsItemNotFoundException
Expand All @@ -153,8 +154,8 @@ public function sendMailFromTemplate(Collection|null $recipientsUsers, Collectio
$variableName = '%' . $this->translator->translate('common.mailing.variable_name.' . $variable->getName()) . '%';
$value = $parameters[$variable->getName()];

$subject = str_replace($variableName, $value, $subject);
$text = str_replace($variableName, $value, $text);
$subject = str_replace($variableName, strval($value), $subject);
$text = str_replace($variableName, strval($value), $text);
}

$this->sendMail(null, null, $recipientsUsers, $recipientsEmails, $subject, $text, true);
Expand Down

0 comments on commit 888866b

Please sign in to comment.