Skip to content

Commit

Permalink
fix: Email layout due to prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
lewislarsen committed Aug 27, 2024
1 parent eaf6aa0 commit c2a90c0
Show file tree
Hide file tree
Showing 19 changed files with 364 additions and 223 deletions.
3 changes: 3 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ public/
package-lock.json
composer.lock

## Ignore all mailables due to using markdown where formatting is precious ##
resources/views/mail/

## Ignored due to prettier issues that can't be resolved automatically atm!
resources/views/components/select.blade.php
resources/views/components/textarea.blade.php
Expand Down
46 changes: 24 additions & 22 deletions resources/views/mail/backup-connection-failure.blade.php
Original file line number Diff line number Diff line change
@@ -1,24 +1,26 @@
<x-mail::message>
# {{ __('Backup Connection Failure') }} - {{ $backupDestination->label }}
({{ $backupDestination->type() . __(' Driver') }}) Hey, {{ $user->first_name }}! Our attempt to connect to your
backup destination, {{ $backupDestination->label }}, which utilizes the {{ $backupDestination->type() }} driver,
was unsuccessful. The error message we encountered is as follows:

<x-mail::panel>
{{ $errorMessage }}
</x-mail::panel>

Common reasons for this error include: - Incorrect credentials - Insufficient permissions Please double-check any
API keys, passwords, or other credentials you have entered for this backup destination. If you are using an
S3-compatible destination, please ensure that the bucket exists and that the credentials you have entered have the
necessary permissions. If you are still encountering issues, please contact our support team at
{{ config('mail.from.address') }}.

<x-mail::button :url="$url">
{{ __('Update Backup Destination') }}
</x-mail::button>

Thanks,
<br />
{{ config('app.name') }}
# {{ __('Backup Connection Failure') }} - {{ $backupDestination->label }} ({{ $backupDestination->type() . __(' Driver') }})

Hey, {{ $user->first_name }}!

Our attempt to connect to your backup destination, {{ $backupDestination->label }}, which utilizes the {{ $backupDestination->type() }} driver, was unsuccessful. The error message we encountered is as follows:

<x-mail::panel>
{{ $errorMessage }}
</x-mail::panel>

Common reasons for this error include:
- Incorrect credentials
- Insufficient permissions

Please double-check any API keys, passwords, or other credentials you have entered for this backup destination. If you are using an S3-compatible destination, please ensure that the bucket exists and that the credentials you have entered have the necessary permissions.

If you are still encountering issues, please contact our support team at {{ config('mail.from.address') }}.

<x-mail::button :url="$url">
{{ __('Update Backup Destination') }}
</x-mail::button>

Thanks,<br>
{{ config('app.name') }}
</x-mail::message>
26 changes: 15 additions & 11 deletions resources/views/mail/backup-task-failed.blade.php
Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@
<x-mail::message>
# {{ __('Backup task failed') }} Hey {{ $user->first_name }}, Your backup task "{{ $taskName }}" has failed. Here
are the details:
# {{ __('Backup task failed') }}

<x-mail::panel>
## Error Message:
Hey {{ $user->first_name }},

{{ $errorMessage }}
</x-mail::panel>
Your backup task "{{ $taskName }}" has failed. Here are the details:

You can view the full task log by checking the run log for the particular task.
<x-mail::panel>
## Error Message:

<x-mail::button :url="route('backup-tasks.index')">View Backup Tasks</x-mail::button>
{{ $errorMessage }}
</x-mail::panel>

Thanks,
<br />
{{ config('app.name') }}
You can view the full task log by checking the run log for the particular task.

<x-mail::button :url="route('backup-tasks.index')">
View Backup Tasks
</x-mail::button>

Thanks,<br>
{{ config('app.name') }}
</x-mail::message>
24 changes: 12 additions & 12 deletions resources/views/mail/backup-tasks/output-mail.blade.php
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
<x-mail::message>
# Backup Task Notification ## Task Label:
{{ $backupTaskLog->backupTask->label }}
# Backup Task Notification ## Task Label:
{{ $backupTaskLog->backupTask->label }}

@if ($backupTaskLog->successful_at)
### Task Status: Successful
@else
### Task Status: Failed
@endif
@if ($backupTaskLog->successful_at)
### Task Status: Successful
@else
### Task Status: Failed
@endif

You can view the task details by clicking the link below:
You can view the task details by clicking the link below:

<x-mail::button :url="route('backup-tasks.index')">View Backup Tasks</x-mail::button>
<x-mail::button :url="route('backup-tasks.index')">View Backup Tasks</x-mail::button>

Thanks,
<br />
{{ config('app.name') }}
Thanks,
<br />
{{ config('app.name') }}
</x-mail::message>
32 changes: 20 additions & 12 deletions resources/views/mail/personal-access-token-expiring-soon.blade.php
Original file line number Diff line number Diff line change
@@ -1,14 +1,22 @@
@component('mail::message')
# Your API Token is Expiring Soon Hey {{ $userName }}, Your API token named "{{ $tokenName }}" is set to expire
soon. Here are the details: - **Created on:** {{ $createdAt }} - **Last used:** {{ $lastUsedAt }} - **Expires
on:** {{ $expiresAt }} (in {{ $daysUntilExpiration }} days) Please take action to renew or replace this token to
ensure uninterrupted access to our API.

@component('mail::button', ['url' => $manageTokensUrl])
Manage Your Tokens
@endcomponent

If you no longer need this token, you can safely ignore this message. Thanks,
<br />
{{ config('app.name') }}
# Your API Token is Expiring Soon

Hey {{ $userName }},

Your API token named "{{ $tokenName }}" is set to expire soon. Here are the details:

- **Created on:** {{ $createdAt }}
- **Last used:** {{ $lastUsedAt }}
- **Expires on:** {{ $expiresAt }} (in {{ $daysUntilExpiration }} days)

Please take action to renew or replace this token to ensure uninterrupted access to our API.

@component('mail::button', ['url' => $manageTokensUrl])
Manage Your Tokens
@endcomponent

If you no longer need this token, you can safely ignore this message.

Thanks,<br>
{{ config('app.name') }}
@endcomponent
23 changes: 14 additions & 9 deletions resources/views/mail/remote-servers/failed-to-remove-key.blade.php
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
<x-mail::message>
# {{ $remoteServer->label }} - Failed to Remove Key Hey, {{ $user->first_name }}! We have failed to remove our SSH
key from the server: {{ $remoteServer->label }}. You can find the error message below:
# {{ $remoteServer->label }} - Failed to Remove Key

<x-mail::panel>
{{ $message }}
</x-mail::panel>
Hey, {{ $user->first_name }}!

Please connect to {{ $remoteServer->label }} through your preferred SSH client and remove the key manually by
navigating to the `~/.ssh/authorized_keys` file. Thanks,
<br />
{{ config('app.name') }}
We have failed to remove our SSH key from the server: {{ $remoteServer->label }}.

You can find the error message below:

<x-mail::panel>
{{ $message }}
</x-mail::panel>

Please connect to {{ $remoteServer->label }} through your preferred SSH client and remove the key manually by navigating to the `~/.ssh/authorized_keys` file.

Thanks,<br>
{{ config('app.name') }}
</x-mail::message>
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
<x-mail::message>
# {{ $remoteServer->label }} - Successfully Removed Key Hey, {{ $user->first_name }}! We have successfully removed
our SSH key from the server: {{ $remoteServer->label }}. If you have any questions, please let us know. Thanks,
<br />
{{ config('app.name') }}
# {{ $remoteServer->label }} - Successfully Removed Key

Hey, {{ $user->first_name }}!

We have successfully removed our SSH key from the server: {{ $remoteServer->label }}.

If you have any questions, please let us know.

Thanks,<br>
{{ config('app.name') }}
</x-mail::message>
23 changes: 16 additions & 7 deletions resources/views/mail/user/device-authentication-log-in.blade.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,20 @@
<x-mail::message>
# Device Login Hey {{ $user->first_name }}, We noticed a new login to your account from a mobile device. If this
was you, no further action is required. However, if you do not recognize this activity, we strongly recommend that
you review your account settings and update your password immediately. To manage your API tokens and review any
recent activity, please click the button below:
# Device Login

<x-mail::button :url="route('profile.api')">Review API Tokens</x-mail::button>
Hey {{ $user->first_name }},

If you have any questions or need assistance, please do not hesitate to contact our support team. Best regards, The
{{ config('app.name') }} Team
We noticed a new login to your account from a mobile device.

If this was you, no further action is required. However, if you do not recognize this activity, we strongly recommend that you review your account settings and update your password immediately.

To manage your API tokens and review any recent activity, please click the button below:

<x-mail::button :url="route('profile.api')">
Review API Tokens
</x-mail::button>

If you have any questions or need assistance, please do not hesitate to contact our support team.

Best regards,
The {{ config('app.name') }} Team
</x-mail::message>
16 changes: 11 additions & 5 deletions resources/views/mail/user/quiet-mode-expired-mail.blade.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
<x-mail::message>
# Hello {{ $first_name }}, Your Quiet Mode period has ended. Here's what this means: - You'll now receive
notifications for any new backup tasks. - You can review any backups that occurred during your Quiet Mode period.
Remember, you can always reactivate Quiet Mode if you need to pause notifications again. Best regards,
<br />
The {{ config('app.name') }} Team
# Hello {{ $first_name }},

Your Quiet Mode period has ended. Here's what this means:

- You'll now receive notifications for any new backup tasks.
- You can review any backups that occurred during your Quiet Mode period.

Remember, you can always reactivate Quiet Mode if you need to pause notifications again.

Best regards,<br>
The {{ config('app.name') }} Team
</x-mail::message>
81 changes: 47 additions & 34 deletions resources/views/mail/user/summary-backup-mail.blade.php
Original file line number Diff line number Diff line change
@@ -1,36 +1,49 @@
<x-mail::message>
# Your Weekly Backup Performance Recap Hey {{ $user->first_name }}, Here's a summary of your backup activities from
{{ $data['date_range']['start'] }} to {{ $data['date_range']['end'] }}. ## Quick Stats - Total Backups:
{{ $data['total_tasks'] }} - Successful: {{ $data['successful_tasks'] }} - Failed: {{ $data['failed_tasks'] }} ##
Performance Breakdown

<x-mail::panel>
Success Rate: {{ number_format($data['success_rate'], 1) }}%

@if ($data['success_rate'] === 100)
🎉 Perfect score! All your backup tasks were successful this week.
@elseif ($data['success_rate'] >= 90)
👍 Great job! Most of your backup tasks were successful.
@elseif ($data['success_rate'] >= 75)
🔍 Good, but there's room for improvement. Check your failed backups logs.
@else
⚠️ Attention needed: A significant number of your backups failed this week.
@endif
</x-mail::panel>

@if ($data['failed_tasks'] > 0)
## Action Required Some of your backup tasks failed this week. We recommend reviewing your backup settings and
logs to address any issues to ensure the safety of your data.

<x-mail::button :url="route('backup-tasks.index')">Review Backup Tasks</x-mail::button>
@else
## Keep Up the Good Work! All your backups were successful this week. Regular backups are crucial for data
safety.

<x-mail::button :url="route('overview')">View Overview</x-mail::button>
@endif

Thank you for using {{ config('app.name') }} to keep your data safe and secure. Best regards,
<br />
The {{ config('app.name') }} Team
# Your Weekly Backup Performance Recap

Hey {{ $user->first_name }},

Here's a summary of your backup activities from {{ $data['date_range']['start'] }} to {{ $data['date_range']['end'] }}.

## Quick Stats
- Total Backups: {{ $data['total_tasks'] }}
- Successful: {{ $data['successful_tasks'] }}
- Failed: {{ $data['failed_tasks'] }}

## Performance Breakdown

<x-mail::panel>
Success Rate: {{ number_format($data['success_rate'], 1) }}%

@if ($data['success_rate'] === 100)
🎉 Perfect score! All your backup tasks were successful this week.
@elseif ($data['success_rate'] >= 90)
👍 Great job! Most of your backup tasks were successful.
@elseif ($data['success_rate'] >= 75)
🔍 Good, but there's room for improvement. Check your failed backups logs.
@else
⚠️ Attention needed: A significant number of your backups failed this week.
@endif
</x-mail::panel>

@if ($data['failed_tasks'] > 0)
## Action Required
Some of your backup tasks failed this week. We recommend reviewing your backup settings and logs to address any issues to ensure the safety of your data.

<x-mail::button :url="route('backup-tasks.index')">
Review Backup Tasks
</x-mail::button>
@else
## Keep Up the Good Work!
All your backups were successful this week. Regular backups are crucial for data safety.

<x-mail::button :url="route('overview')">
View Overview
</x-mail::button>
@endif

Thank you for using {{ config('app.name') }} to keep your data safe and secure.

Best regards,<br>
The {{ config('app.name') }} Team
</x-mail::message>
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
<x-mail::message>
# Backup Code Consumed Hey {{ $user->first_name }}, We're writing to inform you that a backup code for your account
has just been used for authentication. Current status of your backup codes: - Remaining:
{{ $backupCodesRemainingCount }} - Used: {{ $backupCodesConsumedCount }} To ensure continued account security,
consider regenerating your backup codes. You can do this by visiting your
<a href="{{ route('profile.mfa') }}">2FA account settings</a>
. Important: If you did not use this backup code, please take immediate action to secure your account. Thanks,
<br />
{{ config('app.name') }}
# Backup Code Consumed

Hey {{ $user->first_name }},

We're writing to inform you that a backup code for your account has just been used for authentication.

Current status of your backup codes:
- Remaining: {{ $backupCodesRemainingCount }}
- Used: {{ $backupCodesConsumedCount }}

To ensure continued account security, consider regenerating your backup codes. You can do this by visiting your <a href="{{ route('profile.mfa') }}">2FA account settings</a>.

Important: If you did not use this backup code, please take immediate action to secure your account.

Thanks,<br>
{{ config('app.name') }}
</x-mail::message>
23 changes: 16 additions & 7 deletions resources/views/mail/user/two-factor/disabled-mail.blade.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
<x-mail::message>
# Two-Factor Authentication Disabled Hey {{ $user->first_name }}, We're reaching out to inform you that two-factor
authentication (2FA) for your account has been disabled. This change significantly impacts your account security. If
you initiated this action, no further steps are required. However, we recommend keeping 2FA enabled for optimal
account protection. Important: If you did not disable 2FA, your account may be compromised. Please take immediate
action: 1. Log in to your account 2. Change your password 3. Re-enable two-factor authentication Stay secure,
<br />
{{ config('app.name') }}
# Two-Factor Authentication Disabled

Hey {{ $user->first_name }},

We're reaching out to inform you that two-factor authentication (2FA) for your account has been disabled.

This change significantly impacts your account security. If you initiated this action, no further steps are required. However, we recommend keeping 2FA enabled for optimal account protection.

Important: If you did not disable 2FA, your account may be compromised. Please take immediate action:

1. Log in to your account
2. Change your password
3. Re-enable two-factor authentication

Stay secure,<br>
{{ config('app.name') }}
</x-mail::message>
Loading

0 comments on commit c2a90c0

Please sign in to comment.