/**
  * Execute the job.
  *
  * @return void
  */
 public function handle()
 {
     //if( ($user->notifyDueTasks) || ($user->notifyDueActions) || ($user->notifyDueRisks)  )
     $totalcount = 0;
     //$messages = array();
     $actions = null;
     $risks = null;
     //check if user wants action emails
     if ($this->user->notifyDueActions) {
         //compile list of action that are overdue
         $actions = Action::where('actionee', $this->user->id)->DueActions()->get();
         $totalcount += $actions->count();
         //$messages['actions'] = $actions->toArray();
     }
     //check if user wants risk emails
     if ($this->user->notifyDueRisks) {
         //compile list of risks that are overdue
         $risks = Risk::where('owner', $this->user->id)->DueReview()->get();
         $totalcount += $risks->count();
         //$messages['risks'] = $risks->toArray();
     }
     //if there is something due review send it
     if ($totalcount > 0) {
         appMailer::emailUserDueNotfications($this->user, $actions, $risks);
     }
 }
 /**
  * Handle the event.
  *
  * @param  RiskUpdated  $event
  * @return void
  */
 public function handle(RiskUpdated $event)
 {
     $this->mailer->emailUserRiskUpdated($event->risk);
 }