1
0
Fork 0
mirror of synced 2024-07-01 04:30:59 +12:00

Improve magic URL design

This commit is contained in:
Matej Bačo 2024-01-10 11:33:55 +01:00
parent 07b6ee58fe
commit 788fa04606
2 changed files with 5 additions and 6 deletions

View file

@ -11,7 +11,7 @@
"emails.verification.signature": "{{project}} team",
"emails.magicSession.subject": "{{project}} Login",
"emails.magicSession.hello": "Hello,",
"emails.magicSession.optionButton": "Click the button below to securely sign in to your {{project}} account. It will expire in 1 hour.",
"emails.magicSession.optionButton": "Click the button below to securely sign in to your {{projectBold}} account. It will expire in 1 hour.",
"emails.magicSession.buttonText": "Sign in to {{project}}",
"emails.magicSession.optionUrl": "If the button above doesn't show, use the following link:",
"emails.magicSession.clientInfo": "This sign in was requested using {{agentClient}} on {{agentDevice}} {{agentOs}}. If you didn't request the sign in, you can safely ignore this email.",

View file

@ -1035,7 +1035,6 @@ App::post('/v1/account/sessions/magic-url')
$url['query'] = Template::mergeQuery(((isset($url['query'])) ? $url['query'] : ''), ['userId' => $user->getId(), 'secret' => $loginSecret, 'expire' => $expire, 'project' => $project->getId()]);
$url = Template::unParseURL($url);
$body = $locale->getText("emails.magicSession.body");
$subject = $locale->getText("emails.magicSession.subject");
$customTemplate = $project->getAttribute('templates', [])['email.magicSession-' . $locale->default] ?? [];
@ -1046,7 +1045,6 @@ App::post('/v1/account/sessions/magic-url')
$message = Template::fromFile(__DIR__ . '/../../config/locale/templates/email-magic-url.tpl');
$message
->setParam('{{body}}', $body)
->setParam('{{hello}}', $locale->getText("emails.magicSession.hello"))
->setParam('{{optionButton}}', $locale->getText("emails.magicSession.optionButton"))
->setParam('{{buttonText}}', $locale->getText("emails.magicSession.buttonText"))
@ -1108,10 +1106,11 @@ App::post('/v1/account/sessions/magic-url')
'user' => '',
'team' => '',
'project' => $project->getAttribute('name'),
'projectBold' => '<strong>' . $project->getAttribute('name') . '</strong>',
'redirect' => $url,
'agentDevice' => $agentDevice['deviceBrand'] ?? $agentDevice['deviceBrand'] ?? 'UNKNOWN',
'agentClient' => $agentClient['clientName'] ?? 'UNKNOWN',
'agentOs' => $agentOs['osName'] ?? 'UNKNOWN'
'agentDevice' => '<strong>' . ( $agentDevice['deviceBrand'] ?? $agentDevice['deviceBrand'] ?? 'UNKNOWN') . '</strong>',
'agentClient' => '<strong>' . ($agentClient['clientName'] ?? 'UNKNOWN') . '</strong>',
'agentOs' => '<strong>' . ($agentOs['osName'] ?? 'UNKNOWN') . '</strong>'
];
$queueForMails