62 lines
1.9 KiB
PHP
62 lines
1.9 KiB
PHP
<?php
|
|
|
|
namespace App\Notifications;
|
|
|
|
use Illuminate\Bus\Queueable;
|
|
use Illuminate\Contracts\Queue\ShouldQueue;
|
|
use Illuminate\Notifications\Messages\MailMessage;
|
|
use Illuminate\Notifications\Notification;
|
|
|
|
class InstructorApprovalNotification extends Notification
|
|
{
|
|
use Queueable;
|
|
|
|
protected $application;
|
|
|
|
public function __construct($application)
|
|
{
|
|
$this->application = $application;
|
|
}
|
|
|
|
public function via(object $notifiable): array
|
|
{
|
|
return ['mail'];
|
|
}
|
|
|
|
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)
|
|
]);
|
|
}
|
|
|
|
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 [
|
|
//
|
|
];
|
|
}
|
|
} |