Raffales-LMS/app/Mail/NewRegistrationAdminNotification.php
2024-04-16 15:43:24 +05:45

50 lines
1.6 KiB
PHP

<?php
use Illuminate\Bus\Queueable;
use Illuminate\Mail\Mailable;
use Illuminate\Queue\SerializesModels;
class NewRegistrationAdminNotification extends Mailable
{
use Queueable, SerializesModels;
public $registration;
public function __construct($registration)
{
$this->registration = $registration;
}
public function build()
{
$smtpSettings = [
'driver' => 'smtp',
'host' => SITEVARS->smtp_server,
'port' => SITEVARS->smtp_port,
'from' => ['address' => SITEVARS->smtp_user, 'name' => 'Admin'],
'encryption' => SITEVARS->smtp_security,
'username' => SITEVARS->smtp_user,
'password' => SITEVARS->smtp_password,
];
Config::set('mail', $smtpSettings);
return $this->from(config('mail.from.address'))
->subject('New Registration Created')
->view('emails.new_registration_admin_notification');
}
public function registrationSuccess()
{
$smtpSettings = [
'driver' => 'smtp',
'host' => SITEVARS->smtp_server,
'port' => SITEVARS->smtp_port,
'from' => ['address' => SITEVARS->smtp_user, 'name' => 'Admin'],
'encryption' => SITEVARS->smtp_security,
'username' => SITEVARS->smtp_user,
'password' => SITEVARS->smtp_password,
];
Config::set('mail', $smtpSettings);
return $this->from(config('mail.from.address'))
->subject('New Registration Created')
->view('emails.new_registration_admin_notification');
}
}