More bug fixes

This commit is contained in:
Matej Bačo
2024-01-26 10:51:40 +00:00
parent 00cf9c9ac2
commit 70ad2731a3
3 changed files with 6 additions and 5 deletions
+3 -3
View File
@@ -1404,9 +1404,9 @@ App::post('/v1/account/tokens/email')
'team' => '',
'project' => $project->getAttribute('name'),
'otp' => $tokenSecret,
'agentDevice' => '<strong>' . ( $agentDevice['deviceBrand'] ?? $agentDevice['deviceBrand'] ?? 'Unknown device') . '</strong>',
'agentClient' => '<strong>' . ($agentClient['clientName'] ?? 'Unknown client') . '</strong>',
'agentOs' => '<strong>' . ($agentOs['osName'] ?? 'Unknown OS') . '</strong>',
'agentDevice' => '<strong>' . (!empty($agentDevice['deviceBrand']) ? $agentDevice['deviceBrand'] : 'Unknown device') . '</strong>',
'agentClient' => '<strong>' . (!empty($agentOs['clientName']) ? $agentOs['clientName'] : 'Unknown client') . '</strong>',
'agentOs' => '<strong>' . (!empty($agentOs['osName']) ? $agentOs['osName'] : 'Unknown OS') . '</strong>',
'phrase' => '<strong>' . (!empty($securityPhrase) ? $securityPhrase : '') . '</strong>'
];
@@ -429,7 +429,7 @@ class Certificates extends Action
// Send mail to administratore mail
$template = Template::fromFile(__DIR__ . '/../../../../app/config/locale/templates/email-certificate-failed.tpl');
$template->setParam('{{domain}}', $domain);
$template->setParam('{{error}}', \nl2br($errorMessage));
$template->setParam('{{error}}', \nl2br($errorMessage), false);
$template->setParam('{{attempts}}', $attempt);
$subject = 'Certificate for ' . $domain . ' failed to generate';
@@ -437,7 +437,6 @@ class Certificates extends Action
$emailVariables = [
'direction' => $locale->getText('settings.direction'),
'domain' => $domain,
'error' => '<br><pre>' . $errorMessage . '</pre>',
'attempt' => $attempt,
'project' => 'Console',
'redirect' => 'https://' . $domain,
@@ -604,6 +604,8 @@ class ProjectsConsoleClientTest extends Scope
$this->assertEquals(204, $response['headers']['status-code']);
\sleep(5);
$emails = $this->getLastEmail(2);
$this->assertCount(2, $emails);
$this->assertEquals('custommailer@appwrite.io', $emails[0]['from'][0]['address']);