Send messages to owner, not to user when user is demo.

This commit is contained in:
James Cole
2020-11-03 20:33:46 +01:00
parent 433397cb3d
commit 80ef6fcb04
3 changed files with 15 additions and 0 deletions

View File

@@ -52,6 +52,12 @@ class APIEventHandler
$user = $repository->findNull((int) $event->userId);
if (null !== $user) {
$email = $user->email;
// if user is demo user, send to owner:
if($user->hasRole('demo')) {
$email = config('firefly.site_owner');
}
$ipAddress = Request::ip();
// see if user has alternative email address: