Esempio n. 1
0
 public function sendNotification($promoters, $event, $task, $mode)
 {
     $all_input = Input::all();
     foreach ($promoters as $ndx => $promoter) {
         $email_address = $promoter->email;
         $email_content = $all_input['email_content'];
         $email_subject = $all_input['email_subject'];
         $user = Auth::user();
         // create an autologn entry
         $autologin_token = str_random(30);
         $autologin_entry = TaskNotificationAutologin::create(['users_id' => $promoter->id, 'events_id' => $event->id, 'taskevents_id' => $task->id, 'token' => $autologin_token]);
         Mail::send('emails.promoters.notification', array('email_subject' => $email_subject, 'email_message' => $email_content, 'promoter' => $promoter, 'user' => $user, 'event' => $event, 'task' => $task, 'token' => $autologin_token), function ($message) use($promoter, $email_subject) {
             $message->to($promoter->email, $promoter->username)->subject($email_subject);
         });
         eerror_log($mode . ' Sent mail to ' . $promoter->email);
         Debugbar::info($mode . ' Sent mail to ' . $promoter->email . ' task group_id: ' . $task->group_id . ' type ' . $promoter->types()->get());
     }
 }