Skip to content

Commit 2d9b3f4

Browse files
author
Lasim
committed
style(all): update email templates for consistent button styling
1 parent 79ae7fb commit 2d9b3f4

File tree

7 files changed

+14
-55
lines changed

7 files changed

+14
-55
lines changed

services/backend/src/email/templates/admin-password-reset.pug

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ block content
1010
p An administrator has initiated a password reset for your account (#{userEmail}). If you were expecting this action, you can reset your password using the link below.
1111

1212
.text-center
13-
a.button(href=resetUrl style="display: inline-block; padding: 12px 24px; background-color: #007bff; color: white; text-decoration: none; border-radius: 4px; font-weight: bold; margin: 20px 0;") Reset Your Password
13+
a.button(href=resetUrl style="display: inline-block; padding: 12px 24px; background-color: #0f766e; color: white; text-decoration: none; border-radius: 4px; font-weight: bold; margin: 20px 0;") Reset Your Password
1414

1515
p
1616
strong Important security information:
@@ -21,7 +21,7 @@ block content
2121
li If you did not expect this password reset, please contact your administrator immediately
2222

2323
p If the button above doesn't work, you can copy and paste this link into your browser:
24-
p.link-text(style="word-break: break-all; color: #007bff;") #{resetUrl}
24+
p.link-text(style="word-break: break-all; color: #0f766e;") #{resetUrl}
2525

2626
hr(style="margin: 30px 0; border: none; border-top: 1px solid #eee;")
2727

services/backend/src/email/templates/email-verification.pug

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ block content
1010
p Thank you for registering with #{appName || 'DeployStack'}. To complete your account setup, please verify your email address by clicking the button below.
1111

1212
.text-center
13-
a.button(href=verificationUrl style="display: inline-block; padding: 12px 24px; background-color: #007bff; color: white; text-decoration: none; border-radius: 4px; font-weight: bold; margin: 20px 0;") Verify Email Address
13+
a.button(href=verificationUrl style="display: inline-block; padding: 12px 24px; background-color: #0f766e; color: white; text-decoration: none; border-radius: 4px; font-weight: bold; margin: 20px 0;") Verify Email Address
1414

1515
p If the button above doesn't work, you can also copy and paste the following link into your browser:
1616

services/backend/src/routes/auth/adminResetPassword.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ export default async function adminResetPasswordRoute(fastify: FastifyInstance)
6565
fastify.log.info(`Admin-initiated password reset requested by admin ${adminUserId} for email: ${email}`);
6666

6767
// Send admin-initiated reset email
68-
const result = await PasswordResetService.sendAdminResetEmail(email, adminUserId);
68+
const result = await PasswordResetService.sendAdminResetEmail(email, adminUserId, fastify.log);
6969

7070
if (!result.success && result.error) {
7171
fastify.log.error(`Admin password reset failed for ${email} by admin ${adminUserId}: ${result.error}`);

services/backend/src/routes/auth/registerEmail.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,8 @@ export default async function registerEmailRoute(server: FastifyInstance) {
316316
const emailResult = await EmailVerificationService.sendVerificationEmail(
317317
userId,
318318
email.toLowerCase(),
319-
username
319+
username,
320+
request.log
320321
);
321322

322323
if (!emailResult.success) {

services/frontend/src/components/admin/UserActionsGroup.vue

Lines changed: 4 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<script setup lang="ts">
22
import { ref, computed } from 'vue'
33
import { useI18n } from 'vue-i18n'
4+
import { toast } from 'vue-sonner'
45
import { Button } from '@/components/ui/button'
56
import {
67
AlertDialog,
@@ -13,9 +14,7 @@ import {
1314
AlertDialogTitle,
1415
AlertDialogTrigger,
1516
} from '@/components/ui/alert-dialog'
16-
import { Alert, AlertDescription } from '@/components/ui/alert'
1717
import { UserService } from '@/services/userService'
18-
import { CheckCircle, AlertCircle } from 'lucide-vue-next'
1918
import type { User } from '@/views/admin/users/types'
2019
2120
interface Props {
@@ -26,8 +25,6 @@ const props = defineProps<Props>()
2625
const { t } = useI18n()
2726
2827
const isLoading = ref(false)
29-
const successMessage = ref<string | null>(null)
30-
const errorMessage = ref<string | null>(null)
3128
const showDialog = ref(false)
3229
3330
// Check if user can have password reset (only email users)
@@ -39,18 +36,13 @@ const canResetPassword = computed(() => {
3936
const handlePasswordReset = async () => {
4037
try {
4138
isLoading.value = true
42-
errorMessage.value = null
4339
4440
const result = await UserService.adminResetPassword(props.user.email)
4541
4642
if (result.success) {
47-
successMessage.value = t('adminUsers.userDetail.actions.resetPasswordSuccess', {
43+
toast.success(t('adminUsers.userDetail.actions.resetPasswordSuccess', {
4844
email: props.user.email
49-
})
50-
// Auto-hide success message after 5 seconds
51-
setTimeout(() => {
52-
successMessage.value = null
53-
}, 5000)
45+
}))
5446
}
5547
} catch (error) {
5648
const errorKey = 'adminUsers.userDetail.actions.resetPasswordError'
@@ -74,50 +66,16 @@ const handlePasswordReset = async () => {
7466
}
7567
}
7668
77-
errorMessage.value = t(errorKey, { error: errorText })
69+
toast.error(t(errorKey, { error: errorText }))
7870
} finally {
7971
isLoading.value = false
8072
showDialog.value = false
8173
}
8274
}
83-
84-
// Clear messages
85-
const clearMessages = () => {
86-
successMessage.value = null
87-
errorMessage.value = null
88-
}
8975
</script>
9076

9177
<template>
9278
<div class="space-y-4">
93-
<!-- Success Message -->
94-
<Alert v-if="successMessage" class="border-green-200 bg-green-50">
95-
<CheckCircle class="h-4 w-4 text-green-600" />
96-
<AlertDescription class="text-green-800">
97-
{{ successMessage }}
98-
<button
99-
@click="clearMessages"
100-
class="ml-2 text-green-600 hover:text-green-800 underline text-sm"
101-
>
102-
Dismiss
103-
</button>
104-
</AlertDescription>
105-
</Alert>
106-
107-
<!-- Error Message -->
108-
<Alert v-if="errorMessage" variant="destructive">
109-
<AlertCircle class="h-4 w-4" />
110-
<AlertDescription>
111-
{{ errorMessage }}
112-
<button
113-
@click="clearMessages"
114-
class="ml-2 text-red-600 hover:text-red-800 underline text-sm"
115-
>
116-
Dismiss
117-
</button>
118-
</AlertDescription>
119-
</Alert>
120-
12179
<!-- Actions Group -->
12280
<div class="border rounded-lg p-4 bg-gray-50">
12381
<h3 class="text-sm font-medium text-gray-900 mb-3">

services/frontend/src/i18n/locales/en/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export default {
2626
...notFoundMessages,
2727
...adminUsersMessages,
2828
...sidebarMessages,
29-
...verifyEmailMessages,
29+
verifyEmail: verifyEmailMessages,
3030
...forgotPasswordMessages,
3131
...resetPasswordMessages,
3232
...teamsMessages,

services/frontend/src/views/VerifyEmail.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -221,9 +221,9 @@ onMounted(() => {
221221
<div class="flex min-h-full flex-1 flex-col justify-center px-6 py-12 lg:px-8">
222222
<div class="sm:mx-auto sm:w-full sm:max-w-md">
223223
<img
224-
class="mx-auto h-10 w-auto"
225-
src="https://tailwindcss.com/plus-assets/img/logos/mark.svg?color=indigo&shade=600"
226-
alt="Your Company"
224+
class="mx-auto h-20 w-auto"
225+
src="/deploystack-logo-80x80.png"
226+
alt="DeployStack Logo"
227227
/>
228228
<h2 class="mt-10 text-center text-2xl font-bold tracking-tight text-gray-900">
229229
{{ $t('verifyEmail.title') }}

0 commit comments

Comments
 (0)