mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-08-29 09:16:15 +00:00
Send messages to owner, not to user when user is demo.
This commit is contained in:
@@ -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:
|
||||
|
@@ -52,6 +52,11 @@ class AdminEventHandler
|
||||
$email = $event->user->email;
|
||||
$ipAddress = $event->ipAddress;
|
||||
|
||||
// if user is demo user, send to owner:
|
||||
if($event->user->hasRole('demo')) {
|
||||
$email = config('firefly.site_owner');
|
||||
}
|
||||
|
||||
// see if user has alternative email address:
|
||||
$pref = app('preferences')->getForUser($event->user, 'remote_guard_alt_email', null);
|
||||
if (null !== $pref) {
|
||||
|
@@ -65,6 +65,10 @@ class AutomationHandler
|
||||
$email = $pref->data;
|
||||
}
|
||||
|
||||
// if user is demo user, send to owner:
|
||||
if($user->hasRole('demo')) {
|
||||
$email = config('firefly.site_owner');
|
||||
}
|
||||
|
||||
try {
|
||||
Log::debug('Trying to mail...');
|
||||
|
Reference in New Issue
Block a user