1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-13 22:54:25 +01:00
invoiceninja/app/Mail/User/UserLoggedIn.php

60 lines
1.5 KiB
PHP
Raw Normal View History

2021-05-12 08:18:32 +02:00
<?php
2021-06-09 16:57:16 +02:00
2021-05-12 08:18:32 +02:00
/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2021. Invoice Ninja LLC (https://invoiceninja.com)
*
2021-06-16 08:58:16 +02:00
* @license https://www.elastic.co/licensing/elastic-license
2021-05-12 08:18:32 +02:00
*/
namespace App\Mail\User;
use Illuminate\Bus\Queueable;
use Illuminate\Mail\Mailable;
use Illuminate\Queue\SerializesModels;
class UserLoggedIn extends Mailable
{
// use Queueable, SerializesModels;
public $company;
public $user;
public $ip;
/**
* Create a new message instance.
*
* @return void
*/
public function __construct($user, $company, $ip)
{
$this->company = $company;
$this->user = $user;
$this->ip = $ip;
}
/**
* Build the message.
*
* @return $this
*/
public function build()
{
return $this->from(config('mail.from.address'), config('mail.from.name'))
2021-06-09 16:57:16 +02:00
->subject(ctrans('texts.new_login_detected'))
->view('email.admin.notification')
->with([
'settings' => $this->company->settings,
'logo' => $this->company->present()->logo(),
'title' => ctrans('texts.new_login_detected'),
'body' => ctrans('texts.new_login_description', ['email' => $this->user->email, 'ip' => $this->ip, 'time' => now()]),
'whitelabel' => $this->company->account->isPaid(),
]);
2021-05-12 08:18:32 +02:00
}
}