Skip to content

Commit

Permalink
Only send email if an email address was given
Browse files Browse the repository at this point in the history
  • Loading branch information
snipe committed Jul 27, 2015
1 parent 464c835 commit a099d16
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions app/controllers/admin/UsersController.php
Original file line number Diff line number Diff line change
Expand Up @@ -771,10 +771,13 @@ public function postImport()
$data['first_name'] = $row[0];
$data['password'] = $pass;

Mail::send('emails.send-login', $data, function ($m) use ($newuser) {
$m->to($newuser['email'], $newuser['first_name'] . ' ' . $newuser['last_name']);
$m->subject('Welcome ' . $newuser['first_name']);
});
if ($newuser['email') {
Mail::send('emails.send-login', $data, function ($m) use ($newuser) {
$m->to($newuser['email'], $newuser['first_name'] . ' ' . $newuser['last_name']);
$m->subject('Welcome ' . $newuser['first_name']);
});
}

}
}
}
Expand Down

0 comments on commit a099d16

Please sign in to comment.