mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-16 17:57:29 +00:00
Expand notifications.
This commit is contained in:
@@ -34,15 +34,13 @@ class DetectedNewIPAddress extends Event
|
||||
{
|
||||
use SerializesModels;
|
||||
|
||||
public string $ipAddress;
|
||||
public User $user;
|
||||
|
||||
/**
|
||||
* Create a new event instance. This event is triggered when a new user registers.
|
||||
*/
|
||||
public function __construct(User $user, string $ipAddress)
|
||||
public function __construct(User $user)
|
||||
{
|
||||
$this->ipAddress = $ipAddress;
|
||||
$this->user = $user;
|
||||
}
|
||||
}
|
||||
|
@@ -188,7 +188,6 @@ class UserEventHandler
|
||||
public function notifyNewIPAddress(DetectedNewIPAddress $event): void
|
||||
{
|
||||
$user = $event->user;
|
||||
$ipAddress = $event->ipAddress;
|
||||
|
||||
if ($user->hasRole('demo')) {
|
||||
return; // do not email demo user.
|
||||
@@ -203,7 +202,7 @@ class UserEventHandler
|
||||
foreach ($list as $index => $entry) {
|
||||
if (false === $entry['notified']) {
|
||||
try {
|
||||
Notification::send($user, new UserLogin($ipAddress));
|
||||
Notification::send($user, new UserLogin());
|
||||
} catch (\Exception $e) { // @phpstan-ignore-line
|
||||
$message = $e->getMessage();
|
||||
if (str_contains($message, 'Bcc')) {
|
||||
@@ -428,7 +427,7 @@ class UserEventHandler
|
||||
app('preferences')->setForUser($user, 'login_ip_history', $preference);
|
||||
|
||||
if (false === $inArray && true === $send) {
|
||||
event(new DetectedNewIPAddress($user, $ip));
|
||||
event(new DetectedNewIPAddress($user));
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -28,11 +28,13 @@ use FireflyIII\Models\InvitedUser;
|
||||
use FireflyIII\Notifications\Notifiables\OwnerNotifiable;
|
||||
use FireflyIII\Notifications\ReturnsAvailableChannels;
|
||||
use FireflyIII\Notifications\ReturnsSettings;
|
||||
use FireflyIII\Support\Facades\Steam;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Notifications\Messages\MailMessage;
|
||||
use Illuminate\Notifications\Messages\SlackMessage;
|
||||
use Illuminate\Notifications\Notification;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use Illuminate\Support\Facades\Request;
|
||||
use NotificationChannels\Pushover\PushoverMessage;
|
||||
use Ntfy\Message;
|
||||
|
||||
@@ -66,8 +68,14 @@ class UserInvitation extends Notification
|
||||
*/
|
||||
public function toMail(OwnerNotifiable $notifiable)
|
||||
{
|
||||
$ip = Request::ip();
|
||||
$host = Steam::getHostName($ip);
|
||||
$userAgent = Request::userAgent();
|
||||
$time = now(config('app.timezone'))->isoFormat((string) trans('config.date_time_js'));
|
||||
|
||||
|
||||
return (new MailMessage())
|
||||
->markdown('emails.invitation-created', ['email' => $this->invitee->user->email, 'invitee' => $this->invitee->email])
|
||||
->markdown('emails.invitation-created', ['email' => $this->invitee->user->email, 'invitee' => $this->invitee->email, 'ip' => $ip, 'host' => $host, 'userAgent' => $userAgent, 'time' => $time])
|
||||
->subject((string) trans('email.invitation_created_subject'))
|
||||
;
|
||||
}
|
||||
|
@@ -27,12 +27,14 @@ namespace FireflyIII\Notifications\Admin;
|
||||
use FireflyIII\Notifications\Notifiables\OwnerNotifiable;
|
||||
use FireflyIII\Notifications\ReturnsAvailableChannels;
|
||||
use FireflyIII\Notifications\ReturnsSettings;
|
||||
use FireflyIII\Support\Facades\Steam;
|
||||
use FireflyIII\User;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Notifications\Messages\MailMessage;
|
||||
use Illuminate\Notifications\Messages\SlackMessage;
|
||||
use Illuminate\Notifications\Notification;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use Illuminate\Support\Facades\Request;
|
||||
use NotificationChannels\Pushover\PushoverMessage;
|
||||
use Ntfy\Message;
|
||||
|
||||
@@ -66,8 +68,13 @@ class UserRegistration extends Notification
|
||||
*/
|
||||
public function toMail(OwnerNotifiable $notifiable)
|
||||
{
|
||||
$ip = Request::ip();
|
||||
$host = Steam::getHostName($ip);
|
||||
$userAgent = Request::userAgent();
|
||||
$time = now(config('app.timezone'))->isoFormat((string) trans('config.date_time_js'));
|
||||
|
||||
return (new MailMessage())
|
||||
->markdown('emails.registered-admin', ['email' => $this->user->email, 'id' => $this->user->id])
|
||||
->markdown('emails.registered-admin', ['email' => $this->user->email, 'id' => $this->user->id, 'ip' => $ip, 'host' => $host, 'userAgent' => $userAgent, 'time' => $time])
|
||||
->subject((string) trans('email.registered_subject_admin'))
|
||||
;
|
||||
}
|
||||
|
@@ -26,11 +26,13 @@ namespace FireflyIII\Notifications\Security;
|
||||
|
||||
use FireflyIII\Notifications\ReturnsAvailableChannels;
|
||||
use FireflyIII\Notifications\ReturnsSettings;
|
||||
use FireflyIII\Support\Facades\Steam;
|
||||
use FireflyIII\User;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Notifications\Messages\MailMessage;
|
||||
use Illuminate\Notifications\Messages\SlackMessage;
|
||||
use Illuminate\Notifications\Notification;
|
||||
use Illuminate\Support\Facades\Request;
|
||||
use NotificationChannels\Pushover\PushoverMessage;
|
||||
use Ntfy\Message;
|
||||
|
||||
@@ -60,8 +62,12 @@ class DisabledMFANotification extends Notification
|
||||
public function toMail(User $notifiable)
|
||||
{
|
||||
$subject = (string) trans('email.disabled_mfa_subject');
|
||||
$ip = Request::ip();
|
||||
$host = Steam::getHostName($ip);
|
||||
$userAgent = Request::userAgent();
|
||||
$time = now(config('app.timezone'))->isoFormat((string) trans('config.date_time_js'));
|
||||
|
||||
return (new MailMessage())->markdown('emails.security.disabled-mfa', ['user' => $this->user])->subject($subject);
|
||||
return (new MailMessage())->markdown('emails.security.disabled-mfa', ['user' => $this->user, 'ip' => $ip, 'host' => $host, 'userAgent' => $userAgent, 'time' => $time])->subject($subject);
|
||||
}
|
||||
|
||||
public function toNtfy(User $notifiable): Message
|
||||
|
@@ -26,11 +26,13 @@ namespace FireflyIII\Notifications\Security;
|
||||
|
||||
use FireflyIII\Notifications\ReturnsAvailableChannels;
|
||||
use FireflyIII\Notifications\ReturnsSettings;
|
||||
use FireflyIII\Support\Facades\Steam;
|
||||
use FireflyIII\User;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Notifications\Messages\MailMessage;
|
||||
use Illuminate\Notifications\Messages\SlackMessage;
|
||||
use Illuminate\Notifications\Notification;
|
||||
use Illuminate\Support\Facades\Request;
|
||||
use NotificationChannels\Pushover\PushoverMessage;
|
||||
use Ntfy\Message;
|
||||
|
||||
@@ -60,8 +62,12 @@ class EnabledMFANotification extends Notification
|
||||
public function toMail(User $notifiable)
|
||||
{
|
||||
$subject = (string) trans('email.enabled_mfa_subject');
|
||||
$ip = Request::ip();
|
||||
$host = Steam::getHostName($ip);
|
||||
$userAgent = Request::userAgent();
|
||||
$time = now(config('app.timezone'))->isoFormat((string) trans('config.date_time_js'));
|
||||
|
||||
return (new MailMessage())->markdown('emails.security.enabled-mfa', ['user' => $this->user])->subject($subject);
|
||||
return (new MailMessage())->markdown('emails.security.enabled-mfa', ['user' => $this->user, 'ip' => $ip, 'host' => $host, 'userAgent' => $userAgent, 'time' => $time])->subject($subject);
|
||||
}
|
||||
|
||||
public function toNtfy(User $notifiable): Message
|
||||
|
@@ -26,11 +26,13 @@ namespace FireflyIII\Notifications\Security;
|
||||
|
||||
use FireflyIII\Notifications\ReturnsAvailableChannels;
|
||||
use FireflyIII\Notifications\ReturnsSettings;
|
||||
use FireflyIII\Support\Facades\Steam;
|
||||
use FireflyIII\User;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Notifications\Messages\MailMessage;
|
||||
use Illuminate\Notifications\Messages\SlackMessage;
|
||||
use Illuminate\Notifications\Notification;
|
||||
use Illuminate\Support\Facades\Request;
|
||||
use NotificationChannels\Pushover\PushoverMessage;
|
||||
use Ntfy\Message;
|
||||
|
||||
@@ -62,8 +64,12 @@ class MFABackupFewLeftNotification extends Notification
|
||||
public function toMail(User $notifiable)
|
||||
{
|
||||
$subject = (string) trans('email.mfa_few_backups_left_subject', ['count' => $this->count]);
|
||||
$ip = Request::ip();
|
||||
$host = Steam::getHostName($ip);
|
||||
$userAgent = Request::userAgent();
|
||||
$time = now(config('app.timezone'))->isoFormat((string) trans('config.date_time_js'));
|
||||
|
||||
return (new MailMessage())->markdown('emails.security.few-backup-codes', ['user' => $this->user, 'count' => $this->count])->subject($subject);
|
||||
return (new MailMessage())->markdown('emails.security.few-backup-codes', ['user' => $this->user, 'count' => $this->count, 'ip' => $ip, 'host' => $host, 'userAgent' => $userAgent, 'time' => $time])->subject($subject);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -26,11 +26,13 @@ namespace FireflyIII\Notifications\Security;
|
||||
|
||||
use FireflyIII\Notifications\ReturnsAvailableChannels;
|
||||
use FireflyIII\Notifications\ReturnsSettings;
|
||||
use FireflyIII\Support\Facades\Steam;
|
||||
use FireflyIII\User;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Notifications\Messages\MailMessage;
|
||||
use Illuminate\Notifications\Messages\SlackMessage;
|
||||
use Illuminate\Notifications\Notification;
|
||||
use Illuminate\Support\Facades\Request;
|
||||
use NotificationChannels\Pushover\PushoverMessage;
|
||||
use Ntfy\Message;
|
||||
|
||||
@@ -60,8 +62,12 @@ class MFABackupNoLeftNotification extends Notification
|
||||
public function toMail(User $notifiable)
|
||||
{
|
||||
$subject = (string) trans('email.mfa_no_backups_left_subject');
|
||||
$ip = Request::ip();
|
||||
$host = Steam::getHostName($ip);
|
||||
$userAgent = Request::userAgent();
|
||||
$time = now(config('app.timezone'))->isoFormat((string) trans('config.date_time_js'));
|
||||
|
||||
return (new MailMessage())->markdown('emails.security.no-backup-codes', ['user' => $this->user])->subject($subject);
|
||||
return (new MailMessage())->markdown('emails.security.no-backup-codes', ['user' => $this->user, 'ip' => $ip, 'host' => $host, 'userAgent' => $userAgent, 'time' => $time])->subject($subject);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -26,11 +26,13 @@ namespace FireflyIII\Notifications\Security;
|
||||
|
||||
use FireflyIII\Notifications\ReturnsAvailableChannels;
|
||||
use FireflyIII\Notifications\ReturnsSettings;
|
||||
use FireflyIII\Support\Facades\Steam;
|
||||
use FireflyIII\User;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Notifications\Messages\MailMessage;
|
||||
use Illuminate\Notifications\Messages\SlackMessage;
|
||||
use Illuminate\Notifications\Notification;
|
||||
use Illuminate\Support\Facades\Request;
|
||||
use NotificationChannels\Pushover\PushoverMessage;
|
||||
use Ntfy\Message;
|
||||
|
||||
@@ -59,8 +61,12 @@ class MFAManyFailedAttemptsNotification extends Notification
|
||||
public function toMail(User $notifiable)
|
||||
{
|
||||
$subject = (string) trans('email.mfa_many_failed_subject', ['count' => $this->count]);
|
||||
$ip = Request::ip();
|
||||
$host = Steam::getHostName($ip);
|
||||
$userAgent = Request::userAgent();
|
||||
$time = now(config('app.timezone'))->isoFormat((string) trans('config.date_time_js'));
|
||||
|
||||
return (new MailMessage())->markdown('emails.security.many-failed-attempts', ['user' => $this->user, 'count' => $this->count])->subject($subject);
|
||||
return (new MailMessage())->markdown('emails.security.many-failed-attempts', ['user' => $this->user, 'count' => $this->count, 'ip' => $ip, 'host' => $host, 'userAgent' => $userAgent, 'time' => $time])->subject($subject);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -26,11 +26,13 @@ namespace FireflyIII\Notifications\Security;
|
||||
|
||||
use FireflyIII\Notifications\ReturnsAvailableChannels;
|
||||
use FireflyIII\Notifications\ReturnsSettings;
|
||||
use FireflyIII\Support\Facades\Steam;
|
||||
use FireflyIII\User;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Notifications\Messages\MailMessage;
|
||||
use Illuminate\Notifications\Messages\SlackMessage;
|
||||
use Illuminate\Notifications\Notification;
|
||||
use Illuminate\Support\Facades\Request;
|
||||
use NotificationChannels\Pushover\PushoverMessage;
|
||||
use Ntfy\Message;
|
||||
|
||||
@@ -60,8 +62,12 @@ class MFAUsedBackupCodeNotification extends Notification
|
||||
public function toMail(User $notifiable)
|
||||
{
|
||||
$subject = (string) trans('email.used_backup_code_subject');
|
||||
$ip = Request::ip();
|
||||
$host = Steam::getHostName($ip);
|
||||
$userAgent = Request::userAgent();
|
||||
$time = now(config('app.timezone'))->isoFormat((string) trans('config.date_time_js'));
|
||||
|
||||
return (new MailMessage())->markdown('emails.security.used-backup-code', ['user' => $this->user])->subject($subject);
|
||||
return (new MailMessage())->markdown('emails.security.used-backup-code', ['user' => $this->user, 'ip' => $ip, 'host' => $host, 'userAgent' => $userAgent, 'time' => $time])->subject($subject);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -26,11 +26,13 @@ namespace FireflyIII\Notifications\Security;
|
||||
|
||||
use FireflyIII\Notifications\ReturnsAvailableChannels;
|
||||
use FireflyIII\Notifications\ReturnsSettings;
|
||||
use FireflyIII\Support\Facades\Steam;
|
||||
use FireflyIII\User;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Notifications\Messages\MailMessage;
|
||||
use Illuminate\Notifications\Messages\SlackMessage;
|
||||
use Illuminate\Notifications\Notification;
|
||||
use Illuminate\Support\Facades\Request;
|
||||
use NotificationChannels\Pushover\PushoverMessage;
|
||||
use Ntfy\Message;
|
||||
|
||||
@@ -60,8 +62,12 @@ class NewBackupCodesNotification extends Notification
|
||||
public function toMail(User $notifiable)
|
||||
{
|
||||
$subject = (string) trans('email.new_backup_codes_subject');
|
||||
$ip = Request::ip();
|
||||
$host = Steam::getHostName($ip);
|
||||
$userAgent = Request::userAgent();
|
||||
$time = now(config('app.timezone'))->isoFormat((string) trans('config.date_time_js'));
|
||||
|
||||
return (new MailMessage())->markdown('emails.security.new-backup-codes', ['user' => $this->user])->subject($subject);
|
||||
return (new MailMessage())->markdown('emails.security.new-backup-codes', ['user' => $this->user, 'ip' => $ip, 'host' => $host, 'userAgent' => $userAgent, 'time' => $time])->subject($subject);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -26,11 +26,13 @@ namespace FireflyIII\Notifications\Security;
|
||||
|
||||
use FireflyIII\Notifications\ReturnsAvailableChannels;
|
||||
use FireflyIII\Notifications\ReturnsSettings;
|
||||
use FireflyIII\Support\Facades\Steam;
|
||||
use FireflyIII\User;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Notifications\Messages\MailMessage;
|
||||
use Illuminate\Notifications\Messages\SlackMessage;
|
||||
use Illuminate\Notifications\Notification;
|
||||
use Illuminate\Support\Facades\Request;
|
||||
use NotificationChannels\Pushover\PushoverMessage;
|
||||
use Ntfy\Message;
|
||||
|
||||
@@ -57,8 +59,12 @@ class UserFailedLoginAttempt extends Notification
|
||||
public function toMail(User $notifiable)
|
||||
{
|
||||
$subject = (string) trans('email.failed_login_subject');
|
||||
$ip = Request::ip();
|
||||
$host = Steam::getHostName($ip);
|
||||
$userAgent = Request::userAgent();
|
||||
$time = now(config('app.timezone'))->isoFormat((string) trans('config.date_time_js'));
|
||||
|
||||
return (new MailMessage())->markdown('emails.security.failed-login', ['user' => $this->user])->subject($subject);
|
||||
return (new MailMessage())->markdown('emails.security.failed-login', ['user' => $this->user, 'ip' => $ip, 'host' => $host, 'userAgent' => $userAgent, 'time' => $time])->subject($subject);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -26,11 +26,13 @@ namespace FireflyIII\Notifications\User;
|
||||
|
||||
use FireflyIII\Notifications\ReturnsAvailableChannels;
|
||||
use FireflyIII\Notifications\ReturnsSettings;
|
||||
use FireflyIII\Support\Facades\Steam;
|
||||
use FireflyIII\User;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Notifications\Messages\MailMessage;
|
||||
use Illuminate\Notifications\Messages\SlackMessage;
|
||||
use Illuminate\Notifications\Notification;
|
||||
use Illuminate\Support\Facades\Request;
|
||||
use NotificationChannels\Pushover\PushoverMessage;
|
||||
use Ntfy\Message;
|
||||
|
||||
@@ -54,8 +56,13 @@ class NewAccessToken extends Notification
|
||||
*/
|
||||
public function toMail(User $notifiable)
|
||||
{
|
||||
$ip = Request::ip();
|
||||
$host = Steam::getHostName($ip);
|
||||
$userAgent = Request::userAgent();
|
||||
$time = now(config('app.timezone'))->isoFormat((string) trans('config.date_time_js'));
|
||||
|
||||
return (new MailMessage())
|
||||
->markdown('emails.token-created')
|
||||
->markdown('emails.token-created', ['ip' => $ip, 'host' => $host, 'userAgent' => $userAgent, 'time' => $time])
|
||||
->subject((string) trans('email.access_token_created_subject'))
|
||||
;
|
||||
}
|
||||
|
@@ -33,6 +33,7 @@ use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Notifications\Messages\MailMessage;
|
||||
use Illuminate\Notifications\Messages\SlackMessage;
|
||||
use Illuminate\Notifications\Notification;
|
||||
use Illuminate\Support\Facades\Request;
|
||||
use NotificationChannels\Pushover\PushoverMessage;
|
||||
use Ntfy\Message;
|
||||
|
||||
@@ -43,13 +44,6 @@ class UserLogin extends Notification
|
||||
{
|
||||
use Queueable;
|
||||
|
||||
private string $ip;
|
||||
|
||||
public function __construct(string $ip)
|
||||
{
|
||||
$this->ip = $ip;
|
||||
}
|
||||
|
||||
public function toArray(User $notifiable)
|
||||
{
|
||||
return [
|
||||
@@ -61,21 +55,26 @@ class UserLogin extends Notification
|
||||
*/
|
||||
public function toMail(User $notifiable)
|
||||
{
|
||||
$time = now(config('app.timezone'))->isoFormat((string) trans('config.date_time_js'));
|
||||
$ip = Request::ip();
|
||||
$host = Steam::getHostName($ip);
|
||||
$userAgent = Request::userAgent();
|
||||
$time = now(config('app.timezone'))->isoFormat((string) trans('config.date_time_js'));
|
||||
|
||||
return (new MailMessage())
|
||||
->markdown('emails.new-ip', ['time' => $time, 'ipAddress' => $this->ip, 'host' => Steam::getHostName($this->ip)])
|
||||
->markdown('emails.new-ip', ['ip' => $ip, 'host' => $host, 'userAgent' => $userAgent, 'time' => $time])
|
||||
->subject((string) trans('email.login_from_new_ip'))
|
||||
;
|
||||
}
|
||||
|
||||
public function toNtfy(User $notifiable): Message
|
||||
{
|
||||
$ip = Request::ip();
|
||||
$host = Steam::getHostName($ip);
|
||||
$settings = ReturnsSettings::getSettings('ntfy', 'user', $notifiable);
|
||||
$message = new Message();
|
||||
$message->topic($settings['ntfy_topic']);
|
||||
$message->title((string) trans('email.login_from_new_ip'));
|
||||
$message->body((string) trans('email.slack_login_from_new_ip', ['host' => Steam::getHostName($this->ip), 'ip' => $this->ip]));
|
||||
$message->body((string) trans('email.slack_login_from_new_ip', ['ip' => $ip, 'host' => $host, ]));
|
||||
|
||||
return $message;
|
||||
}
|
||||
@@ -85,7 +84,9 @@ class UserLogin extends Notification
|
||||
*/
|
||||
public function toPushover(User $notifiable): PushoverMessage
|
||||
{
|
||||
return PushoverMessage::create((string) trans('email.slack_login_from_new_ip', ['host' => Steam::getHostName($this->ip), 'ip' => $this->ip]))
|
||||
$ip = Request::ip();
|
||||
$host = Steam::getHostName($ip);
|
||||
return PushoverMessage::create((string) trans('email.slack_login_from_new_ip', ['ip' => $ip, 'host' => $host, ]))
|
||||
->title((string) trans('email.login_from_new_ip'))
|
||||
;
|
||||
}
|
||||
@@ -95,7 +96,9 @@ class UserLogin extends Notification
|
||||
*/
|
||||
public function toSlack(User $notifiable)
|
||||
{
|
||||
return new SlackMessage()->content((string) trans('email.slack_login_from_new_ip', ['host' => Steam::getHostName($this->ip), 'ip' => $this->ip]));
|
||||
$ip = Request::ip();
|
||||
$host = Steam::getHostName($ip);
|
||||
return new SlackMessage()->content((string) trans('email.slack_login_from_new_ip', ['ip' => $ip, 'host' => $host, ]));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -26,11 +26,13 @@ namespace FireflyIII\Notifications\User;
|
||||
|
||||
use FireflyIII\Notifications\ReturnsAvailableChannels;
|
||||
use FireflyIII\Notifications\ReturnsSettings;
|
||||
use FireflyIII\Support\Facades\Steam;
|
||||
use FireflyIII\User;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Notifications\Messages\MailMessage;
|
||||
use Illuminate\Notifications\Messages\SlackMessage;
|
||||
use Illuminate\Notifications\Notification;
|
||||
use Illuminate\Support\Facades\Request;
|
||||
use NotificationChannels\Pushover\PushoverMessage;
|
||||
use Ntfy\Message;
|
||||
|
||||
@@ -62,8 +64,13 @@ class UserNewPassword extends Notification
|
||||
*/
|
||||
public function toMail(User $notifiable)
|
||||
{
|
||||
$ip = Request::ip();
|
||||
$host = Steam::getHostName($ip);
|
||||
$userAgent = Request::userAgent();
|
||||
$time = now(config('app.timezone'))->isoFormat((string) trans('config.date_time_js'));
|
||||
|
||||
return (new MailMessage())
|
||||
->markdown('emails.password', ['url' => $this->url])
|
||||
->markdown('emails.password', ['url' => $this->url, 'ip' => $ip, 'host' => $host, 'userAgent' => $userAgent, 'time' => $time])
|
||||
->subject((string) trans('email.reset_pw_subject'))
|
||||
;
|
||||
}
|
||||
|
@@ -1,3 +1,9 @@
|
||||
@component('mail::message')
|
||||
{{ trans('email.invitation_created_body', ['email' => $email,'invitee' => $invitee]) }}
|
||||
|
||||
- {{ trans('email.date_time') }}: {{ $time }}
|
||||
- {{ trans('email.ip_address') }}: {{ $ip }}
|
||||
- {{ trans('email.host_name') }}: {{ $host }}
|
||||
- {{ trans('email.user_agent') }}: {{ $userAgent }}
|
||||
|
||||
@endcomponent
|
||||
|
@@ -1,13 +1,11 @@
|
||||
@component('mail::message')
|
||||
{{ trans('email.new_ip_body') }}
|
||||
|
||||
{{ trans('email.ip_address') }}: {{ $ipAddress }}
|
||||
|
||||
@if('' !== $host)
|
||||
{{ trans('email.host_name') }}: {{ $host }}
|
||||
@endif
|
||||
|
||||
{{ trans('email.date_time') }}: {{ $time }}
|
||||
|
||||
{{ trans('email.new_ip_warning') }}
|
||||
|
||||
- {{ trans('email.ip_address') }}: {{ $ip }}
|
||||
- {{ trans('email.host_name') }}: {{ $host }}
|
||||
- {{ trans('email.date_time') }}: {{ $time }}
|
||||
- {{ trans('email.user_agent') }}: {{ $userAgent }}
|
||||
|
||||
@endcomponent
|
||||
|
@@ -5,4 +5,9 @@
|
||||
|
||||
{{ trans('email.oauth_created_undo', ['url' => route('profile.index')] ) }}
|
||||
|
||||
- {{ trans('email.ip_address') }}: {{ $ip }}
|
||||
- {{ trans('email.host_name') }}: {{ $host }}
|
||||
- {{ trans('email.date_time') }}: {{ $time }}
|
||||
- {{ trans('email.user_agent') }}: {{ $userAgent }}
|
||||
|
||||
@endcomponent
|
||||
|
@@ -5,4 +5,9 @@
|
||||
|
||||
{{ $url }}
|
||||
|
||||
- {{ trans('email.ip_address') }}: {{ $ip }}
|
||||
- {{ trans('email.host_name') }}: {{ $host }}
|
||||
- {{ trans('email.date_time') }}: {{ $time }}
|
||||
- {{ trans('email.user_agent') }}: {{ $userAgent }}
|
||||
|
||||
@endcomponent
|
||||
|
@@ -3,4 +3,9 @@
|
||||
|
||||
{{ trans('email.disabled_mfa_warning') }}
|
||||
|
||||
- {{ trans('email.date_time') }}: {{ $time }}
|
||||
- {{ trans('email.ip_address') }}: {{ $ip }}
|
||||
- {{ trans('email.host_name') }}: {{ $host }}
|
||||
- {{ trans('email.user_agent') }}: {{ $userAgent }}
|
||||
|
||||
@endcomponent
|
||||
|
@@ -3,4 +3,9 @@
|
||||
|
||||
{{ trans('email.enabled_mfa_warning') }}
|
||||
|
||||
- {{ trans('email.date_time') }}: {{ $time }}
|
||||
- {{ trans('email.ip_address') }}: {{ $ip }}
|
||||
- {{ trans('email.host_name') }}: {{ $host }}
|
||||
- {{ trans('email.user_agent') }}: {{ $userAgent }}
|
||||
|
||||
@endcomponent
|
||||
|
@@ -3,4 +3,9 @@
|
||||
|
||||
{{ trans('email.failed_login_warning') }}
|
||||
|
||||
- {{ trans('email.date_time') }}: {{ $time }}
|
||||
- {{ trans('email.ip_address') }}: {{ $ip }}
|
||||
- {{ trans('email.host_name') }}: {{ $host }}
|
||||
- {{ trans('email.user_agent') }}: {{ $userAgent }}
|
||||
|
||||
@endcomponent
|
||||
|
@@ -3,4 +3,9 @@
|
||||
|
||||
{{ trans('email.few_backup_codes_warning') }}
|
||||
|
||||
- {{ trans('email.date_time') }}: {{ $time }}
|
||||
- {{ trans('email.ip_address') }}: {{ $ip }}
|
||||
- {{ trans('email.host_name') }}: {{ $host }}
|
||||
- {{ trans('email.user_agent') }}: {{ $userAgent }}
|
||||
|
||||
@endcomponent
|
||||
|
@@ -3,4 +3,9 @@
|
||||
|
||||
{{ trans('email.mfa_many_failed_attempts_warning') }}
|
||||
|
||||
- {{ trans('email.date_time') }}: {{ $time }}
|
||||
- {{ trans('email.ip_address') }}: {{ $ip }}
|
||||
- {{ trans('email.host_name') }}: {{ $host }}
|
||||
- {{ trans('email.user_agent') }}: {{ $userAgent }}
|
||||
|
||||
@endcomponent
|
||||
|
@@ -3,4 +3,9 @@
|
||||
|
||||
{{ trans('email.new_backup_codes_warning') }}
|
||||
|
||||
- {{ trans('email.date_time') }}: {{ $time }}
|
||||
- {{ trans('email.ip_address') }}: {{ $ip }}
|
||||
- {{ trans('email.host_name') }}: {{ $host }}
|
||||
- {{ trans('email.user_agent') }}: {{ $userAgent }}
|
||||
|
||||
@endcomponent
|
||||
|
@@ -3,4 +3,9 @@
|
||||
|
||||
{{ trans('email.no_backup_codes_warning') }}
|
||||
|
||||
- {{ trans('email.date_time') }}: {{ $time }}
|
||||
- {{ trans('email.ip_address') }}: {{ $ip }}
|
||||
- {{ trans('email.host_name') }}: {{ $host }}
|
||||
- {{ trans('email.user_agent') }}: {{ $userAgent }}
|
||||
|
||||
@endcomponent
|
||||
|
@@ -3,4 +3,9 @@
|
||||
|
||||
{{ trans('email.used_backup_code_warning') }}
|
||||
|
||||
- {{ trans('email.date_time') }}: {{ $time }}
|
||||
- {{ trans('email.ip_address') }}: {{ $ip }}
|
||||
- {{ trans('email.host_name') }}: {{ $host }}
|
||||
- {{ trans('email.user_agent') }}: {{ $userAgent }}
|
||||
|
||||
@endcomponent
|
||||
|
@@ -4,4 +4,10 @@
|
||||
{{ trans('email.access_token_created_explanation') }}
|
||||
|
||||
{{ trans('email.access_token_created_revoke', ['url' => route('profile.index')]) }}
|
||||
|
||||
- {{ trans('email.ip_address') }}: {{ $ip }}
|
||||
- {{ trans('email.host_name') }}: {{ $host }}
|
||||
- {{ trans('email.date_time') }}: {{ $time }}
|
||||
- {{ trans('email.user_agent') }}: {{ $userAgent }}
|
||||
|
||||
@endcomponent
|
||||
|
Reference in New Issue
Block a user