Email config alert
Added alert box to convey that email has not been setup
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
namespace App\Http\ViewComposers;
|
||||
|
||||
use App\Model\helpdesk\Agent\Department;
|
||||
use App\Model\helpdesk\Email\Emails;
|
||||
use App\Model\helpdesk\Settings\Company;
|
||||
use App\Model\helpdesk\Ticket\Tickets;
|
||||
use App\User;
|
||||
@@ -28,13 +29,14 @@ class AgentLayout
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(Company $company, User $users, Tickets $tickets, Department $department)
|
||||
public function __construct(Company $company, User $users, Tickets $tickets, Department $department, Emails $emails)
|
||||
{
|
||||
$this->company = $company;
|
||||
$this->auth = Auth::user();
|
||||
$this->users = $users;
|
||||
$this->tickets = $tickets;
|
||||
$this->department = $department;
|
||||
$this->emails = $emails;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -58,6 +60,7 @@ class AgentLayout
|
||||
'department' => $this->departments(),
|
||||
'overdues' => $this->overdues(),
|
||||
'due_today' => $this->getDueToday(),
|
||||
'is_mail_conigured' => $this->getEmailConfig(),
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -194,4 +197,21 @@ class AgentLayout
|
||||
->whereRaw('date(duedate) = ?', [date('Y-m-d')]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @category function to check configured mails
|
||||
*
|
||||
* @var $emails
|
||||
*
|
||||
* @return bool true/false
|
||||
*/
|
||||
public function getEmailConfig()
|
||||
{
|
||||
$emails = $this->emails->where('sending_status', '=', 1)->where('fetching_status', '=', 1)->count();
|
||||
if ($emails >= 1) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user