From 3ee08f0029ef241c12ddc84bd16fbb286640c0e2 Mon Sep 17 00:00:00 2001 From: baghizadizn Date: Fri, 28 Nov 2025 15:48:52 +0700 Subject: [PATCH] refactor code untuk notifikasi email --- .../CustomEmailVerificationNotification.php | 2 +- .../CustomResetPasswordNotification.php | 2 +- .../InstructorApprovalNotification.php | 30 +----- .../instructor_approval.blade.php | 94 +++++++++++++++++++ 4 files changed, 101 insertions(+), 27 deletions(-) create mode 100644 resources/views/vendor/notifications/instructor_approval.blade.php diff --git a/app/Notifications/CustomEmailVerificationNotification.php b/app/Notifications/CustomEmailVerificationNotification.php index f132aed..0754bf5 100644 --- a/app/Notifications/CustomEmailVerificationNotification.php +++ b/app/Notifications/CustomEmailVerificationNotification.php @@ -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); } diff --git a/app/Notifications/CustomResetPasswordNotification.php b/app/Notifications/CustomResetPasswordNotification.php index ac94ca0..63893b6 100644 --- a/app/Notifications/CustomResetPasswordNotification.php +++ b/app/Notifications/CustomResetPasswordNotification.php @@ -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))); } } diff --git a/app/Notifications/InstructorApprovalNotification.php b/app/Notifications/InstructorApprovalNotification.php index 437d890..366d60e 100644 --- a/app/Notifications/InstructorApprovalNotification.php +++ b/app/Notifications/InstructorApprovalNotification.php @@ -25,38 +25,18 @@ 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 [ // ]; } -} \ No newline at end of file +} diff --git a/resources/views/vendor/notifications/instructor_approval.blade.php b/resources/views/vendor/notifications/instructor_approval.blade.php new file mode 100644 index 0000000..85fbba6 --- /dev/null +++ b/resources/views/vendor/notifications/instructor_approval.blade.php @@ -0,0 +1,94 @@ + + + + + + {{ get_phrase('Instructor Application Approved') }} + + + +
+ + + +
+ +