This commit is contained in:
sujitprasad
2015-12-24 18:39:37 +05:30
parent 0e085c7beb
commit 5fc77c9205
21 changed files with 172 additions and 73 deletions

View File

@@ -59,7 +59,7 @@ class Handler extends ExceptionHandler {
// }
// return response()->view('errors.500', []);
// }
// return parent::render($request, $e);
return parent::render($request, $e);
if ($this->isHttpException($e))
{

View File

@@ -248,6 +248,7 @@ class SettingsController extends Controller {
$emails->fill($request->except('email_fetching', 'all_emails', 'email_collaborator', 'strip', 'attachment'))->save();
/* insert checkboxes to database */
$emails->email_fetching = $request->input('email_fetching');
$emails->notification_cron = $request->input('notification_cron');
$emails->all_emails = $request->input('all_emails');
$emails->email_collaborator = $request->input('email_collaborator');
$emails->strip = $request->input('strip');

View File

@@ -115,10 +115,9 @@ class MailController extends Controller {
// echo $_SERVER['DOCUMENT_ROOT'];
$dir_img_paths = __DIR__;
$dir_img_path = explode('/code', $dir_img_paths);
$filepath = explode('../../../../../../public/',$attachment->filePath);
// dd($filepath);
// $path = $dir_img_path[0]."/public/".$filepath[1];
$path = public_path().'/'.$filepath[1];
$filepath = explode('../../../../../public/',$attachment->filePath);
$path = $dir_img_path[0]."/code/public/".$filepath[1];
// dd($path);
$filesize = filesize($path);
$file_data = file_get_contents($path);

View File

@@ -7,6 +7,8 @@ use App\User;
use App\Model\helpdesk\Settings\Company;
use App\Model\helpdesk\Agent\Teams;
use App\Model\helpdesk\Agent\Department;
use App\Model\helpdesk\Utility\Log_notification;
use App\Model\hrlpdesk\settings\Email;
/**
* UserController
@@ -22,12 +24,20 @@ class NotificationController extends Controller {
* @return mail
**/
public function send_notification() {
// $this->test();
$company = $this->company();
// $this->send_notification_to_admin($company);
// $this->send_notification_to_team_lead($company);
// $this->send_notification_to_manager($company);
// $this->send_notification_to_agent($company);
$email = Email::where('id','=','1')->first();
if($email->notification_cron == 1){
$notification = Log_notification::where('log','=','NOT-1')->orderBy('id','DESC')->first();
$date = explode(" " , $notification->created_at);
if(Date('Y-m-d') == $date[0]){
} else {
Log_notification::create(['log'=>'NOT-1']);
$company = $this->company();
$this->send_notification_to_admin($company);
$this->send_notification_to_team_lead($company);
$this->send_notification_to_manager($company);
$this->send_notification_to_agent($company);
}
}
}
/**

View File

@@ -1118,7 +1118,7 @@ class TicketController extends Controller {
$create_user->password = Hash::make($password);
$create_user->save();
$user_id = $create_user->id;
Mail::send('emails.pass', ['password' => $password, 'name' => $name, 'from'=>$company], function ($message) use ($email, $name) {
Mail::send('emails.pass', ['password' => $password, 'name' => $name, 'from'=>$company,'emailadd' => $email], function ($message) use ($email, $name) {
$message->to($email, $name)->subject('password');
});
}
@@ -1308,7 +1308,7 @@ class TicketController extends Controller {
$user->role = 'user';
if ($user->save()) {
$user_id = $user->id;
Mail::send('emails.pass', ['password' => $password, 'name' => $name, 'from'=>$company], function ($message) use ($email, $name) {
Mail::send('emails.pass', ['password' => $password, 'name' => $name, 'from'=>$company,'emailadd'=>$email], function ($message) use ($email, $name) {
$message->to($email, $name)->subject('password');
});
}

View File

@@ -0,0 +1,11 @@
<?php namespace App\Model\helpdesk\Utility;
use Illuminate\Database\Eloquent\Model;
class Log_notification extends Model {
protected $table = 'log_notification';
protected $fillable = ['id', 'log'];
}