Commit 9ae2d3c7 authored by Tibo's avatar Tibo

Fix #14

parent 7b8948ab
Pipeline #2067 passed with stage
in 47 seconds
......@@ -21,12 +21,13 @@ class Notification extends Model
$this->save();
$change = $this->change();
$mail = new \App\Mail\StatusChanged($change);
$mail_class = \App\Mail\StatusChanged::class;
if ($this->type == "bouncing") {
$mail = new \App\Mail\StatusBouncing($change);
$mail_class = \App\Mail\StatusBouncing::class;
}
foreach ($this->server->organization->users as $user) {
$mail = new $mail_class($change);
Mail::to($user)->send($mail);
}
}
......
......@@ -28,6 +28,13 @@ class ExampleTest extends TestCase
$this->assertTrue(true);
}
public function testClassInstance()
{
$class = Server::class;
$server = new $class;
$this->assertEquals("App\Server", get_class($server));
}
public function testRelations()
{
$user = new User();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment