refactor code untuk notifikasi email
This commit is contained in:
parent
5a0aab856b
commit
3ee08f0029
@ -23,7 +23,7 @@ class CustomEmailVerificationNotification extends Notification
|
||||
$verificationUrl = $this->verificationUrl($notifiable);
|
||||
|
||||
return (new MailMessage)
|
||||
->subject('Custom Email Verification Subject')
|
||||
->subject(get_phrase('Custom Email Verification Subject'))
|
||||
->action('Verify Email Address', $verificationUrl);
|
||||
}
|
||||
|
||||
|
||||
@ -21,7 +21,7 @@ class CustomResetPasswordNotification extends Notification
|
||||
public function toMail($notifiable)
|
||||
{
|
||||
return (new MailMessage)
|
||||
->subject('Custom Password Reset Subject')
|
||||
->subject(get_phrase('Custom Password Reset Subject'))
|
||||
->action('Reset Password', url(config('app.url').route('password.reset', $this->token, false)));
|
||||
}
|
||||
}
|
||||
|
||||
@ -25,34 +25,14 @@ class InstructorApprovalNotification extends Notification
|
||||
|
||||
public function toMail(object $notifiable): MailMessage
|
||||
{
|
||||
$actionUrl = url('/instructor/dashboard');
|
||||
|
||||
return (new MailMessage)
|
||||
->subject('Instructor Application Approved - GROWNESA')
|
||||
->view('vendor.notifications.email', [
|
||||
'actionUrl' => $actionUrl,
|
||||
'actionText' => 'Access Instructor Dashboard',
|
||||
'extraMessage' => $this->buildEmailContent($notifiable)
|
||||
->subject(get_phrase('Instructor Application Approved') . ' - ' . config('app.name'))
|
||||
->view('vendor.notifications.instructor_approval', [
|
||||
'user' => $notifiable,
|
||||
'application' => $this->application
|
||||
]);
|
||||
}
|
||||
|
||||
protected function buildEmailContent($notifiable)
|
||||
{
|
||||
$content = "Congratulations " . $notifiable->name . "!\n\n";
|
||||
$content .= "We are pleased to inform you that your instructor application has been approved.\n\n";
|
||||
$content .= "Application ID: " . $this->application->id . "\n\n";
|
||||
$content .= "You now have access to:\n";
|
||||
$content .= "• Instructor Dashboard\n";
|
||||
$content .= "• Course Creation Tools\n";
|
||||
$content .= "• Bootcamp Creation Tools\n";
|
||||
$content .= "• Blog Creation Tools\n";
|
||||
$content .= "• Revenue Tracking and Analytics\n\n";
|
||||
$content .= "If you have any questions, please contact our support team.\n\n";
|
||||
$content .= "Thank you for joining our instructor community!";
|
||||
|
||||
return $content;
|
||||
}
|
||||
|
||||
public function toArray(object $notifiable): array
|
||||
{
|
||||
return [
|
||||
|
||||
94
resources/views/vendor/notifications/instructor_approval.blade.php
vendored
Normal file
94
resources/views/vendor/notifications/instructor_approval.blade.php
vendored
Normal file
@ -0,0 +1,94 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>{{ get_phrase('Instructor Application Approved') }}</title>
|
||||
<style>
|
||||
/* Copy the same styles from your email.blade.php */
|
||||
body {
|
||||
font-family: Arial, sans-serif;
|
||||
background-color: #f9f9f9;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
.email-container {
|
||||
max-width: 600px;
|
||||
margin: 0 auto;
|
||||
background-color: #ffffff;
|
||||
border-radius: 8px;
|
||||
overflow: hidden;
|
||||
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
.email-header {
|
||||
background-color: #ffffff;
|
||||
color: #000;
|
||||
text-align: center;
|
||||
padding: 20px;
|
||||
font-size: 24px;
|
||||
font-weight: bold;
|
||||
}
|
||||
.email-body {
|
||||
padding: 20px;
|
||||
color: #333333;
|
||||
font-size: 16px;
|
||||
line-height: 1.6;
|
||||
}
|
||||
.email-body .button-container {
|
||||
text-align: center;
|
||||
margin: 20px 0;
|
||||
}
|
||||
.email-body a.button {
|
||||
display: inline-block;
|
||||
background-color: #2f57ef;
|
||||
color: white;
|
||||
padding: 12px 24px;
|
||||
text-decoration: none;
|
||||
border-radius: 5px;
|
||||
font-size: 16px;
|
||||
font-weight: bold;
|
||||
}
|
||||
.email-footer {
|
||||
background-color: #f0f3ff;
|
||||
color: #2f57ef;
|
||||
text-align: center;
|
||||
padding: 10px;
|
||||
font-size: 14px;
|
||||
border-top: 1px solid #dddddd;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="email-container">
|
||||
<div class="email-header">
|
||||
{{ get_phrase('Instructor Application Approved') }}
|
||||
</div>
|
||||
<div class="email-body">
|
||||
<p><strong>{{ get_phrase('Congratulations') }} {{ $user->name }}!</strong></p>
|
||||
<p>{{ get_phrase('We are pleased to inform you that your instructor application has been approved.') }}</p>
|
||||
<p><strong>{{ get_phrase('Application ID') }}:</strong> {{ $application->id }}</p>
|
||||
|
||||
<p>{{ get_phrase('You now have access to') }}:</p>
|
||||
<ul>
|
||||
<li>{{ get_phrase('Instructor Dashboard') }}</li>
|
||||
<li>{{ get_phrase('Course Creation Tools') }}</li>
|
||||
<li>{{ get_phrase('Bootcamp Creation Tools') }}</li>
|
||||
<li>{{ get_phrase('Blog Creation Tools') }}</li>
|
||||
<li>{{ get_phrase('Revenue Tracking and Analytics') }}</li>
|
||||
</ul>
|
||||
|
||||
<div class="button-container">
|
||||
<a href="{{ url('/instructor/dashboard') }}" class="button">
|
||||
{{ get_phrase('Access Instructor Dashboard') }}
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<p>{{ get_phrase('If you have any questions, please contact our support team.') }}</p>
|
||||
<p>{{ get_phrase('Thank you for joining our instructor community!') }}</p>
|
||||
</div>
|
||||
<div class="email-footer">
|
||||
<p>{{ config('app.name') }}</p>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
Loading…
Reference in New Issue
Block a user