I am trying to send email notification to user regarding approval or rejection of an application. When a user submits an application to the admin, the admin can either accept of reject the users application or send the application to super admin for further verification.
When the admin accepts or rejects the application, I can send an email to the user email to inform him/her regarding the outcome. However, when the admin send the application to superadmin for further verification, I am not being able to send an email to the super admin.
in the controller i am doing something like this to check what the admins input is
$status = $notification->approved;
if ($status == 2)
{
$string = 'Approved';
$user->notify(new NotificationApplicationStatus($user->name, $notification->id, $string));
return redirect()->route('admin.notification_list');
}else if($status == 5){
$string = 'Rejected';
$user->notify(new NotificationApplicationStatus($user->name, $notification->id, $string));
return redirect()->route('admin.notification_list');
}else if ($status == 1){
$string = 'Verify';
$user->notify(new NotificationApplicationStatus($user->name, $notification->id, $string));
return redirect()->route('admin.notification_list');
}
In the NotificationApplicationStatus.php i have something like this
public function toMail($notifiable)
{
return (new MailMessage)
->line('Your Notification Application '.$this->id.' has been '.$this->string)
->line('Review Application with the link below')
->action('Notification Application '.$this->id , url('http://localhost:8000'))
->line('Thank you for using our application!');
}
To send email to user. How can i send email to super admin in case the admin wishes to verify. please Help.
via Mill3r