Beispiel #1
0
 /**
  * Sends an e-mail to all present registrations that a meal has been cancelled
  * @param  App\Models\Meal $meal
  * @return void
  */
 public static function mealIsDestroyedEmail(\App\Models\Meal $meal)
 {
     foreach ($meal->registrations as $registration) {
         Mail::send(['mails/mealIsDestroyed/html', 'mails/mealIsDestroyed/text'], ['meal' => $meal, 'registration' => $registration], function ($message) use($meal, $registration) {
             $message->to($registration->email, $registration->name);
             $message->subject("Maaltijd " . $meal->longDate() . ' gaat niet door');
         });
     }
 }