Skip to content

Commit

Permalink
chore: Update email templates with user information
Browse files Browse the repository at this point in the history
  • Loading branch information
pmagictech committed Jun 7, 2024
1 parent b942c47 commit 7aff384
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/Authentication/Actions/Email2FA.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public function handle(IncomingRequest $request)
$email->setSubject(lang('Auth.email2FASubject'));
$email->setMessage($this->view(
setting('Auth.views')['action_email_2fa_email'],
['code' => $identity->secret, 'ipAddress' => $ipAddress, 'userAgent' => $userAgent, 'date' => $date],
['code' => $identity->secret, 'user' => $user, 'ipAddress' => $ipAddress, 'userAgent' => $userAgent, 'date' => $date],
['debug' => false]
));

Expand Down
2 changes: 1 addition & 1 deletion src/Authentication/Actions/EmailActivator.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public function show(): string
$email->setSubject(lang('Auth.emailActivateSubject'));
$email->setMessage($this->view(
setting('Auth.views')['action_email_activate_email'],
['code' => $code, 'ipAddress' => $ipAddress, 'userAgent' => $userAgent, 'date' => $date],
['code' => $code, 'user' => $user, 'ipAddress' => $ipAddress, 'userAgent' => $userAgent, 'date' => $date],
['debug' => false]
));

Expand Down
2 changes: 1 addition & 1 deletion src/Controllers/MagicLinkController.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ public function loginAction()
$email->setSubject(lang('Auth.magicLinkSubject'));
$email->setMessage($this->view(
setting('Auth.views')['magic-link-email'],
['token' => $token, 'ipAddress' => $ipAddress, 'userAgent' => $userAgent, 'date' => $date],
['token' => $token, 'user' => $user, 'ipAddress' => $ipAddress, 'userAgent' => $userAgent, 'date' => $date],
['debug' => false]
));

Expand Down
3 changes: 2 additions & 1 deletion src/Views/Email/email_2fa_email.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,10 @@
</tbody>
</table>
<b><?= lang('Auth.emailInfo') ?></b>
<p><?= lang('Auth.username') ?>: <?= esc($user->username) ?></p>
<p><?= lang('Auth.emailIpAddress') ?> <?= esc($ipAddress) ?></p>
<p><?= lang('Auth.emailDevice') ?> <?= esc($userAgent) ?></p>
<p><?= lang('Auth.emailDate') ?> <?= esc($date) ?></p>
</body>

</html>
</html>
1 change: 1 addition & 0 deletions src/Views/Email/email_activate_email.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
</tbody>
</table>
<b><?= lang('Auth.emailInfo') ?></b>
<p><?= lang('Auth.username') ?>: <?= esc($user->username) ?></p>
<p><?= lang('Auth.emailIpAddress') ?> <?= esc($ipAddress) ?></p>
<p><?= lang('Auth.emailDevice') ?> <?= esc($userAgent) ?></p>
<p><?= lang('Auth.emailDate') ?> <?= esc($date) ?></p>
Expand Down
3 changes: 2 additions & 1 deletion src/Views/Email/magic_link_email.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,10 @@
</tbody>
</table>
<b><?= lang('Auth.emailInfo') ?></b>
<p><?= lang('Auth.username') ?>: <?= esc($user->username) ?></p>
<p><?= lang('Auth.emailIpAddress') ?> <?= esc($ipAddress) ?></p>
<p><?= lang('Auth.emailDevice') ?> <?= esc($userAgent) ?></p>
<p><?= lang('Auth.emailDate') ?> <?= esc($date) ?></p>
</body>

</html>
</html>

0 comments on commit 7aff384

Please sign in to comment.